freak4 Posted August 9, 2013 Share Posted August 9, 2013 I have this code in one of my files: $requiredFields = array(); foreach ($fields as $key => $field) { if (1 == $field['required']) { $requiredFields[$key] = $field['message']; } } Getting error: Warning: Invalid argument supplied for foreach() in /home/USER/public_html/register.php on line 79 Anybody help? thank you. Quote Link to comment https://forums.phpfreaks.com/topic/281007-warning-invalid-argument-supplied-for-foreach/ Share on other sites More sharing options...
fastsol Posted August 9, 2013 Share Posted August 9, 2013 It's saying that $fields is not an array when it gets to the foreach loop. Quote Link to comment https://forums.phpfreaks.com/topic/281007-warning-invalid-argument-supplied-for-foreach/#findComment-1444215 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.