Version: 0.02b
Type: Full Script
Category: Math Functions
License: GNU General Public License
Description: This simple script generate prime numbers (2,3,5,7,11,13,17 ...) Using method recursive.
<?
function check_prime_number ( $f ) {
$no = 0;
for( $b=2 ; $b<=$f ; $b++ ) {
for( $d=2 ; $d<$b ; $d++ ) {
$res = $b / $d;
if( $res!=1 && intval($res)==$res ) {
$no=1;
$d=$b;
}
}
if( $no!=1 ) $result = $b;
$no=0;
}
if( $result == $f ) return 1;
else return 0;
}
$result = check_prime_number(11);
echo( $result );
?>