有人可以帮助我,我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