i need a php function that can result like this. example when i call the function
echo Prime(4,3);
2 3 5 7
11 13 17 19
23 29 31 37
anyone can help please help me.
i need a php function that can result like this. example when i call the function
echo Prime(4,3);
2 3 5 7
11 13 17 19
23 29 31 37
anyone can help please help me.
function primenumbers($n, $m){
$number = $n*$m;
$numCounter = 0;
$i = 0;
while($numCounter < $number){
$counter = 0;
for($j=1;$j<=$i;$j++){
if($i % $j==0){
$counter++;
}
}
if($counter==2){
print $i." ";
$numCounter++;
}
if($numCounter % $m == 0){
print "<br>";
}
$i++;
}
}
echo primenumbers(3,5);