Jump to content

How To Check Array For Prime Number?


phpQuestioner

Recommended Posts

that doesn't quit do what I am trying to accomplish

 

here is what I have:

 

for ($i = 0; $i < $tp; $i++)
{
$display="15";
$pganteqty = $display * $i;
$ci = $i + 1;
if($ci<=3) {
$checker1 = $display * 3;
$checker2 = $display * 6;
if (($skip >= $checker1) && ($skip <= $checker2))
  {
   echo " <a href=\"$thispage?skip=". ($pganteqty + ($display * 3)) ."\">". ($ci + 3) ."</a> ";
  }
else
  {
   echo " <a href=\"$thispage?skip=$pganteqty\">$ci</a> ";
  }
}
}

 

now instead of using a lot of if else conditions to accomplish this; I want to figure out how to do this every time my "skip" variable is increases by 30 (30,60,90,120, and so on.........).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.