kproctor Posted March 19, 2017 Share Posted March 19, 2017 I have the below code that is returning the following error: Warning: Invalid argument supplied for foreach() in /Library/WebServer/Documents/lessons101/scrapping.php on line 677 The number 7 is the result of the echo statement. I did this to confirm that a value is being passed. When I replace the $fi_key_exisiting variable in the for each statement the correct result is returned. I have no idea what's causing the error. Thoughts please. $fi_key_exisiting = $_SESSION['existing_fi']; if (empty($fi_key_existing)) { $fi_key_existing = 0; } else { $fi_key_existing = $fi_key_existing; } echo $fi_key_exisiting; $selected_lender = ($lender_list[$fi_key_exisiting]); foreach($selected_lender as $item) { $fi_name = $item[0]; $variable = $item[1]; $six_months = $item[2]; $one_year = $item[3]; $two_year = $item[4]; $three_year = $item[5]; $four_years = $item[6]; $five_years = $item[7]; } Quote Link to comment Share on other sites More sharing options...
Solution kproctor Posted March 19, 2017 Author Solution Share Posted March 19, 2017 I got it to work.. I had a typo.... Quote Link to comment 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.