## Find Factorial of given number

 Code Block
`<?phpecho find_fact(4); function find_fact(\$number){    \$fact=1;    for(\$i=1;\$i<=\$number;\$i++){    	\$fact=\$fact*\$i;    }    return \$fact;}?>`

## Find prime numbers between the range

 Code Block
`<?php \$start=0;\$end=100;\$prime_numbers=array();for(\$i=\$start;\$i<=\$end;\$i++){	if(is_prime(\$i)==true){		\$prime_numbers[]=\$i;	}} var_dump(\$prime_numbers);function is_prime(\$num){	\$no=\$num;	\$prime=true;	for(\$i=2;\$i<=(\$no/2);\$i++)	{		if(\$no%\$i==0){			\$prime=false;			break;		}	}	return \$prime;} ?>`

## prime no or not

First of all, I want to tell you that what is the prime no.

Prime no is the no which can’t be divided by other than 1 and itself.

## Prime No? Yes : No;

 Code Block
`<?php\$no=8;\$prime=true;for(\$i=2;\$i<(\$no/2);\$i++){    if(\$no%\$i==0){        \$prime=false;        break;    }}if(\$prime==true){    echo "<br/>Number is Prime<br/>";}else{    echo "<br/>Number is not prime<br/>";}?>`

## String is palindrome or not

 Code Block
`<?php\$origing_str = "khan";\$opesite_str="";\$leng = strlen(\$origing_str);\$str_array=str_split(\$origing_str);for(\$i=\$leng-1;\$i>=0;\$i--){    \$opesite_str.= \$str_array[\$i];}if(\$origing_str==\$opesite_str){	echo 'string is palindrome';}else{	echo 'string is not palindrome';}?>`

## Find the opposite in PHP

 Code Block
`<?php\$origing_str = 1234;\$origing_str.="";\$opesite_str="";\$leng = strlen(\$origing_str);\$str_array=str_split(\$origing_str);for(\$i=\$leng-1;\$i>=0;\$i--){	\$opesite_str.= \$str_array[\$i];}echo "Opposite Number: ".(int)\$opesite_str; ?>`