有人可以幫助我,我stuck.Dont知道爲什麼這不工作PHP目錄列表問題?
$myPath = get_bloginfo('wpurl').'/wp-content/uploads/'; // this is full path
function ReadDirList($d){
$dir = opendir($d);
$fs = "";
while($folder = readdir($dir))
{
//if(is_dir($folder)){
$fs = $fs. '<option>'.$folder.'</option>';
//}
}
closedir($dir);
echo $fs;
}
我調用這個函數<select> <?php ReadDirList($myPath); ?> </select>
TNX提前。
它究竟是如何失敗?在尋求幫助時,請始終說明您期望的行爲和您得到的行爲,包括任何錯誤消息。 – outis 2010-04-22 22:46:07
對不起,我是一個新的here.It打印空字符串,像$ fs是空的 – user147 2010-04-22 22:49:41