我喜歡PHP獲取一個目錄列表VAR transfert
glob("*.jpg");
或
$dir = '.'; //requested directory to read
$notthat = array('.', '..'); //what not to include
$listedfiles = array_diff(scandir($dir), $notthat); // removed what not to include
,所以我想這個數組發送到這樣一個javascript(幻燈片= $ listedfiles )
function startSlideshow(slides) { .. do something..}
這樣做的最佳方法是什麼?