Going crazy.. i know my problem has got to be simple.
Posted: Tue Jan 27, 2009 4:06 pm
But I can't figure out what it is......
Basically I have xspf playlists stored on my server, and I want to be able to read them so I can extract individual pieces of info from them, and eventually allow others to make changes to the playlist themselves(like change the order of songs).
I'm trying to write a basic function right now basically just outputting the number of tracks an artist has, and all the info from one of them.
This is the error message I get:
Any ideas?
Basically I have xspf playlists stored on my server, and I want to be able to read them so I can extract individual pieces of info from them, and eventually allow others to make changes to the playlist themselves(like change the order of songs).
I'm trying to write a basic function right now basically just outputting the number of tracks an artist has, and all the info from one of them.
This is the error message I get:
I tried upping the memory in the php.ini file a couple of times, as you can see by the huge allowed mem. size, but that didn't work. Besides there's no reason why it should be taking up so much memory. Btw LINE 2432 is line 19 in here.....Fatal error: Allowed memory size of 104857600 bytes exhausted (tried to allocate 5084 bytes) in /home/wants0/public_html/wp-includes/functions.php on line 2432
Code: Select all
function get_playlist_info($theartname)
{
$numberoftracks= 0;
$xspfname= $theartname . ".xspf";
$pl = fopen($xspfname, "r");
$size= filesize($xspfname);
$data= fread($pl, $size);
$endoftracklist = stripos($data, "</tracklist>");
fseek($pl,0);
$beginningoflist= stripos($data, "<track>");
fseek($pl,0);
$currentlocation= 0;
while ($currentlocation<=$endoftracklist)
{
$trackpos= stripos($data, "<track>");
fseek($pl, $trackpos);
$endtrackpos= stripos($data, "</track>");
$trackinfo[$numberoftracks]= fread($pl, $endtrackpos);
$numberoftracks++;
$currentlocation= $beginningoflist+ $trackpos+ $endtrackpos;
fseek($pl,$currentlocation);
} //while not end of file
fclose($pl);
echo $theartname . " has " . $numberoftracks . " tracks";
echo "<BR><BR>";
echo $trackinfo[1];
} //end of function get_playlist_info