Jump to content

for() issue on doing next pages. I just lost today


sprintlife

Recommended Posts

Hey guys,

 

You guys do great work here and maybe you can shine some light on an issue I am having.  I know a few ways I can making do a work around.  But I want to see if you guys can come up with something better.

 

for($i = ($page - 4); $i <= $total_pages; $i++) {
   	if(($page) == $i) {
      echo $i . " ";
} elseif($i <= ($page + '4')) {
      echo "<a href=\"http://domainname.com/cp/$pagenext/$i\">$i</a> ";
} 
} 

 

How do I get it to start from 0 once it's at page 1?  It works great when I am page 5 and higher LOL.

 

 

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.