日期:2014-05-17  浏览次数:20576 次

请问下PHP怎么样才可以确认是否支持filetype呢


按道理说这个地方的filetype应该颜色不一样才对,但是这里不知道为什么颜色还是黑色呢,我不知道哪里写错了,贴上代码

<meta http-equiv="content-type" content="text/html"; charset=utf-8>
<?php


$num=0;
$dirname='function';
$dir_handle=opendir($dirnmae);
//循环出所有的文件

echo '<table border=1 align="center" width="1000" cellspacing="0" cellpadding="0">';
echo '<caption><h2>目录'.$dirname.'下面的内容</h2></caption>';
echo '<tr align="left" bgcolor="#CCCCCC">';
echo '<th>文件名</th><th>文件大小</th><th>文件类型</th><th>修改时间</th>';

while($file=readdir($dir_handle)){
$dirfile=$dirname.'/'.$file;
$bgcolor=$num++%2==0 ? '#FFFFFF' : '$CCCCCC';
echo '<tr bgcolor='.$bgcolor.'>';
echo '<td>'.$file.'</td>';
echo '<td>'.filesize($dirfile).'</td>'; 
echo '<td>'.filetype($dirfile).'</td>';
echo '<td>'.date('Y/n/t',filetime($dirfile)).'</td>';
echo '</tr>';
}
echo '</table>';
closedir($dir_handle);
echo '在<b>'.$dirname.'</b>目录下的子目录和文件共有<b>'.$num.'</b>个';

------解决方案--------------------
没有高亮怎么办 ~
------解决方案--------------------
ide的问题