php readdir 为什么在本机上能读出目录,在服务器上就不行,为什么,跟php.ini设置有关吗线上等候 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $directory = 'c:/';$d = opendir($directory);while (false !== ($file = readdir($d))) { if(is_dir($directory.$file)) { if($file == '..') { $path = back($directory,2); $c[] = '<li style="line-height:20px; height:20px;padding:0px;margin-top:10px;"><strong><a href="?type=dir&directory='.$path.'"><img src="back.gif" style="margin:-4px 5px;border:0px;" />Parent Directory</a></strong></li>'; }elseif($file == '.') { $path = back($directory,1); $c[] = '<li style="line-height:20px; height:20px;padding:0px; margin:0px;border-bottom:2px #171717 solid;"><span style="float:right">Last modified Size </span><strong>Index of '.$path.'</strong></li>'; }else { $c[] = '<li style="line-height:20px; height:20px;padding:0px; margin:0px;"><span style="float:right">'.date ("Y-m-d H:i:s", filemtime($directory.$file)).'</span><a href="?type=dir&directory='.$directory.'&name='.$file.'"><img src="folder.gif" style="margin:-4px 5px;border:0px;" />'.$file.'</a></li>'; } }else { $f[] = '<li style="line-height:20px; height:20px;padding:0px; margin:0px;"><span style="float:right">'.date ("Y-m-d H:i:s", filemtime($directory.$file)).' '.convert(filesize($directory.$file)).'</span><a style="margin-left:26px;" href="?type=file&directory='.$directory.'&name='.$file.'&act=view">'.$file.'</a></li>'; } } readdir()读取的时候 赋给最在权限 求数组组合算法 请问做新闻站时“相关文章”是怎样匹配的 有没有必要对PDO进行封装? 一个初学PHP的问题. 急:如何实现查询数据库多行、多列分页显示??? 关于在smarty里面处理循环嵌套 文件名提取问题??急 请问:我链接数据库时。提示“数据库出现小问题”,那是什么原因造成的?不过我不是链接本机的数据库。 在window平台开发的php移植到linux平台下,麻烦吗?需要注意些什么? mysql的float类型很奇怪的 数组处理 ,高手帮下忙 如何用最快最有效率的方法筛选掉重复数据。
$directory = 'c:/';
$d = opendir($directory);
while (false !== ($file = readdir($d))) {
if(is_dir($directory.$file)) {
if($file == '..') {
$path = back($directory,2);
$c[] = '<li style="line-height:20px; height:20px;padding:0px;margin-top:10px;"><strong><a href="?type=dir&directory='.$path.'"><img src="back.gif" style="margin:-4px 5px;border:0px;" />Parent Directory</a></strong></li>';
}elseif($file == '.') {
$path = back($directory,1);
$c[] = '<li style="line-height:20px; height:20px;padding:0px; margin:0px;border-bottom:2px #171717 solid;"><span style="float:right">Last modified Size </span><strong>Index of '.$path.'</strong></li>';
}else {
$c[] = '<li style="line-height:20px; height:20px;padding:0px; margin:0px;"><span style="float:right">'.date ("Y-m-d H:i:s", filemtime($directory.$file)).'</span><a href="?type=dir&directory='.$directory.'&name='.$file.'"><img src="folder.gif" style="margin:-4px 5px;border:0px;" />'.$file.'</a></li>';
}
}else {
$f[] = '<li style="line-height:20px; height:20px;padding:0px; margin:0px;"><span style="float:right">'.date ("Y-m-d H:i:s", filemtime($directory.$file))
.' '.convert(filesize($directory.$file)).'</span><a style="margin-left:26px;" href="?type=file&directory='.$directory.'&name='.$file.'&act=view">'.$file.'</a></li>';
}
}