<?php// header("content-type:application/json");$dir = "../Music";$dh = opendir($dir);while (false !== ($filename = readdir($dh))) { if($filename!="."&&$filename!="..") { $files[] = $filename; }}sort($files);//print_r($files);echo json_encode($files);?>
js:
function getAudioFileList(){ $.get("php/audio.php",function(data){ console.log(data); },"json"); }
新闻热点
疑难解答