【发布时间】:2010-04-22 22:43:39
【问题描述】:
谁能帮我解决这个问题,我被卡住了。不知道为什么这不起作用
$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。
【问题讨论】:
-
究竟是如何失败的?寻求帮助时,请始终说明您期望的行为和得到的行为,包括任何错误消息。
-
对不起,我是新来的。它打印空字符串,比如 $fs 是空的