Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What are the main objectives of Inventory ?

Answered: 1 week ago

Question

Explain the various inventory management techniques in detail.

Answered: 1 week ago

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago