I'm trying to run a foreach loop in php to go through each line of a csv file, I actually got the setup for this loop from another post on stackoverflow (but it's also described the same on php.net).
My code is:
$csvFile = file('MajorCourses.csv')
foreach($csvFile as &$line)
{
$data[] = str_getcsv($line)
}
And the php file is in the same directory as my php file, but I get this error:
"Parse error: syntax error, unexpected 'foreach' (T_FOREACH) in C:\wamp2\www\advisingApp.php on line 23"
I'm not sure why it's "unexpected", I'm new to php. But the loop is in php tags.