按道理说这个地方的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的问题
试着换下其他的编辑器看看。
明白了,谢谢各位
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号