PHP 下拉檔案選單 Home » PHP » PHP 下拉檔案選單 $filetypes = array("wav", "aac"); //設定要秀出的副檔名 echo "\n"; foreach (new DirectoryIterator('/var/www/b30_bak') as $file) { //指定web server上的路徑位置 $filetype = pathinfo($file, PATHINFO_EXTENSION); if (in_array(strtolower($filetype), $filetypes)) { //如果符合副檔名設定才秀出來 echo '' . htmlentities($file) . "\n"; } } echo '';?>
0 意見:
張貼留言