Question
if (isset($_GET['action'])) { if ((file_exists(SongOrganizer/songs.txt)) && (filesize(SongOrganizer/songs.txt)!= 0)) { $SongArray = file(SongOrganizer/songs.txt); switch ($_GET['action']) { case 'Remove Duplicates': $SongArray = array_unique($SongArray); $SongArray = array_values($SongArray); break;
if (isset($_GET['action'])) { if ((file_exists("SongOrganizer/songs.txt")) && (filesize("SongOrganizer/songs.txt")!= 0)) { $SongArray = file("SongOrganizer/songs.txt"); switch ($_GET['action']) { case 'Remove Duplicates': $SongArray = array_unique($SongArray); $SongArray = array_values($SongArray); break; case 'Sort Ascending': sort($SongArray); break; case 'Shuffle': shuffle($SongArray); break; }// End of the switch statement if (count($SongArray)>0) { $NewSongs = implode($SongArray); $SongStore = fopen("SongOrganizer/Songs.txt","wb"); if ($SongStore === false) echo "There was an error updating the song file "; else { fwrite($SongStore, $NewSongs); fclose($SongStore); } } else unlink ("SongOrganizer/songs.txt"); }}
What am I doing wrong I am still getting errors. The curly bracelet may be in the wrong place?
What am I doing work?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started