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