cooldude832 Posted May 18, 2007 Share Posted May 18, 2007 This is my array: (n represents a counting number of array values $page[$currentpage][n]: 1 2 3 4 $currentpage is produced from a get var in the URL I then say foreach($page[$currentpage] as $value) it works fine if the limit isn't messed with manually, but when a users makes $limit into a different number outside the limits of $page[$currentpage] or to a string my foreach errors out. Is there a way to say if it will error out don't do it without testing the var $currentpage. like: foreach($n as $v) or die ('error'); Link to comment https://forums.phpfreaks.com/topic/51954-help-with-a-foreach-loop/ Share on other sites More sharing options...
neel_basu Posted May 18, 2007 Share Posted May 18, 2007 I am totally confused (didn't understand what you asked) $currentpage is produced from a get var in the URLPost that Get var it works fine if the limit ................What is the limit . from where it comes ?? Please explain. Link to comment https://forums.phpfreaks.com/topic/51954-help-with-a-foreach-loop/#findComment-256102 Share on other sites More sharing options...
cooldude832 Posted May 18, 2007 Author Share Posted May 18, 2007 I see its confusion and i posted a different topic asking what i'm really saying sorry Link to comment https://forums.phpfreaks.com/topic/51954-help-with-a-foreach-loop/#findComment-256103 Share on other sites More sharing options...
neel_basu Posted May 18, 2007 Share Posted May 18, 2007 Post the url of that topic here. Link to comment https://forums.phpfreaks.com/topic/51954-help-with-a-foreach-loop/#findComment-256104 Share on other sites More sharing options...
cooldude832 Posted May 18, 2007 Author Share Posted May 18, 2007 http://www.phpfreaks.com/forums/index.php/topic,141264.0.html Link to comment https://forums.phpfreaks.com/topic/51954-help-with-a-foreach-loop/#findComment-256105 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.