This forum is now read-only. Please use our new forums at

Control Flow: Switch Forum

View Course » View Exercise

62 points
Submitted by
over 3 years ago

Parse error: syntax error, unexpected 'case' (T_CASE) help!

ok, so when I checked the code, it said there was an error with case 'Remove Duplicates':

Here is the section of code itself if (isset($GET['action'])) {
if ((file
&& (filesize("songorganizer/songs.txt")
!= 0)) {
$SongArray = file("songorganizer/songs.txt");
switch ($_GET['action']) {
} // End of the switch statement
case 'Remove Duplicates':

Now I've searched on google and supposedly there is supposed to be something above the error text in question that's causing said error, but as far as I can see, there's no mistakes to be found, I am very confused and wold appreciate some help

0 votes


Hi there,

I think you'll have better luck if you ask somewhere like CodeHive :)

2835 points
Submitted by
Zeke Y
about 3 years ago