Initial commit of the Labchain OS software

This commit is contained in:
Norbert Schmidt
2021-12-20 09:55:27 +01:00
committed by GitHub
parent 10a270e506
commit 247b8dac6a
82 changed files with 115892 additions and 2 deletions

34
includes/playlist.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
function generatePlaylist ($dir)
{
// Basisfunctionaliteit voor een JSON-achtige playlist
$return_array = array();
if(is_dir($dir)){
if($dh = opendir($dir)){
while(($file = readdir($dh)) != false){
if($file == "." or $file == ".." or $file =="playlist.json"){
} else {
$return_array[] = $file; // Add the file to the array
}
}
}
$ds ="/";
$savePath=$dir . $ds ."playlist.json";
$fileContent= json_encode($return_array);
$file = fopen($savePath,"w");
fwrite($file,$fileContent);
fclose($file);
}
}
?>