I have this piece of code which works, however I would like to change the function to “sort by name” opposed to “sort by date”.
The code below is not mine (Please refer to PHP Sort function by date (JWPLAYER auto playlist script))
$folder = scandir($path);
$files = array();
foreach($folder as $file){
if($file == '.' OR $file == '..' OR $file == 'index.htm'){}else{
$files[$file] = filemtime($path.'/'.$file);
}
}
arsort($files);
Thanks
To conclude.
With all the above information you can use JW Player to:
- To scan folder for video file and automatically create a playlist in XML
- Sort by date or sort by name
Thank you
If
$filescontains filename as a key then replacewith