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. 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. 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
Archived
This topic is now archived and is closed to further replies.