arunss created this script but has not updated my request since then can anyone help me with this mode to his already good script ?
See Below for that I need to add
<?php
$songs = file('songs.txt');
var_dump($songs);
echo "<br /><br /><h3>result</h3>";
$filtered_songs = array_unique($songs);
var_dump($filtered_songs);
if(sizeof($filtered_songs)>0)
{
$content = "";
foreach($filtered_songs as $song)
{
$content = $content.$song;
}
}
$myFile = "newfile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $content);
fclose($fh);
?>
arunss TY for all your help that is EXACTLY what I needed now all I need is the same idea but I need a seperate script that will run thru each hour of the day
EX:
1am 2am 3am 4am 4am 6am 7am 8am 9am 10am 11am 12pm ... 12am
and take each hours file ( say for ex 10am.txt ) and add all the songs in each file to one file for that day ... ( ex playlistsun.txt for sunday , or playlistmon.txt for monday ETC ETC ...
so in effect it needs to open each hours file and append it to one file in order from 12am to 11pm for each day based on the servers day and time ... and dont worry about telling it when to run I want to do this once a night thru a cron job ...
Thank you so much if you can help ... or anyone else ...
please have it name the file playlistsun.txt or playlistmon.txt based on the day it is on the server ...
Thanks
Midnite