Hi lets say we have this values :
$total = 317;
$x = 5;
$numpages = ceil($total / $x);
i need to loop over $total value and echo result like this
i=1 , numpage = 1
i=2 , numpage = 1
i=3 , numpage = 1
i=4 , numpage = 1
i=5 , numpage = 1
i=6 , numpage = 2
i=7 , numpage = 2
i=8 , numpage = 2
i=9 , numpage = 2
i=10 , numpage = 2
until....
i=317 , numpage = 64
i don't want to use manual if statement like this
for ($i = 0; $i <= $total; $i++) {
if($i <= 5)
numpage = 1
if($i <= 10)
numpage = 2
}
becuase $x = 5; could change as i want i need formula that works with any x value thanks