psquinn Posted July 25, 2011 Share Posted July 25, 2011 Hi all, Having issue with running a drop down menu in a site i am working on. (new to PHP) I am getting the error message "Invalid argument supplied for foreach()" . The section of code i am having trouble with is: <?php foreach( $menus as $menu ) { $class = empty( $menu->childs ) ? ' class="no-child"' : ''; ?> Any help you can give is appreciated. Thanks Link to comment https://forums.phpfreaks.com/topic/242719-invalid-argument-supplied-for-foreach/ Share on other sites More sharing options...
trq Posted July 25, 2011 Share Posted July 25, 2011 $menus is obviously not an array or object. Where do you define it? Link to comment https://forums.phpfreaks.com/topic/242719-invalid-argument-supplied-for-foreach/#findComment-1246659 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.