Prime Numbers

From CodeCodex

<?

$f= 1000;

$no=0;

function int($num){

    $g = gettype($num);

    if($g == "integer"){

	return $num;
    }
    else
    {
        return "0";
    }
}

for($b=2;$b<$f;$b++){

	for($d=2;$d<$b;$d++){

	    $res= $b / $d;

	    if($res!=1 && int($res)==$res){
    		$no=1;
		$d=$b;

    	    }

	}

    if($no!=1) { print " the $b is Prime number <br>\n";}

    $no=0;

}

?>