kts Posted May 14, 2008 Share Posted May 14, 2008 Hey, im using a function to reset and grab each array. When its looping through its fine, but I'm getting this warning I never seemed to have gotten except on Godaddy hosting. Warning: reset() [function.reset]: Passed variable is not an array or object When I set the variable in the URL it removes the error, but without it set i get the warning. I tried setting $_GET['var'] = 0; just to make the warning disappear, but it did not work. Anyone have any suggestions? Link to comment https://forums.phpfreaks.com/topic/105586-need-help-with-php-warnings/ Share on other sites More sharing options...
trq Posted May 14, 2008 Share Posted May 14, 2008 Anyone have any suggestions? Yeah, post the relevent code. Link to comment https://forums.phpfreaks.com/topic/105586-need-help-with-php-warnings/#findComment-540888 Share on other sites More sharing options...
947740 Posted May 14, 2008 Share Posted May 14, 2008 We are not really able to help you unless you post something to help you with. Sure, the error can help us make general statments about the possible problem, but they are not going to be what you need. Link to comment https://forums.phpfreaks.com/topic/105586-need-help-with-php-warnings/#findComment-540892 Share on other sites More sharing options...
kts Posted May 14, 2008 Author Share Posted May 14, 2008 Ok well some of it is third party, so I will go ahead and figure it out. Thanks though, It must be trying to loop too much. I'll let you know! heh Link to comment https://forums.phpfreaks.com/topic/105586-need-help-with-php-warnings/#findComment-540895 Share on other sites More sharing options...
The Little Guy Posted May 14, 2008 Share Posted May 14, 2008 before you pass your variable, make sure the value is an array... That is what is wrong your probably passing a string, number, boolean or some other value, try this: <?php if(is_array($someValue)){ echo 'This is a valid variable.'; reset($someValue); }else{ echo 'This variable will fail the rest function.'; } ?> Link to comment https://forums.phpfreaks.com/topic/105586-need-help-with-php-warnings/#findComment-540921 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.