Invalid Argument Suppplied foreach()
The foreach loop is a fine way to split apart an array and output separate values. Howver, you must ensure an array exists and can be output as desired. If you make a mistake and do not create an array (but thought you did), you may get an error like the one below.
Warning: Invalid argument supplied for foreach() in C:\wamp\www\ABOOK\SORTING\TABLES\filename.php on line 162
To get to the through the root of the problem you can backtrack and make sure your array and its values are properly represented. Using print_r() always help in showing your array. If the array is good, the next step would be to analyze the items within the array.