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'); Quote 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. Quote 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 Quote 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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.