Home > Backend Development > PHP Tutorial > 请教下PHP如何样才可以确认是否支持filetype呢

请教下PHP如何样才可以确认是否支持filetype呢

WBOY
Release: 2016-06-13 12:35:40
Original
1037 people have browsed it

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


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

<meta http-equiv="content-type" content="text/html"; charset=utf-8><br />
<?php<br />
<br />
	<br />
	$num=0;<br />
	$dirname='function';<br />
	$dir_handle=opendir($dirnmae);<br />
	//循环出所有的文件<br />
<br />
	echo '<table border=1 align="center" width="1000" cellspacing="0" cellpadding="0">';<br />
	echo '<caption><h2>目录'.$dirname.'下面的内容</h2></caption>';<br />
	echo '<tr align="left" bgcolor="#CCCCCC">';<br />
	echo '<th>文件名</th><th>文件大小</th><th>文件类型</th><th>修改时间</th>';<br />
	<br />
	while($file=readdir($dir_handle)){<br />
		$dirfile=$dirname.'/'.$file;<br />
		$bgcolor=$num++%2==0 ? '#FFFFFF' : '$CCCCCC';<br />
		echo '<tr bgcolor='.$bgcolor.'>';<br />
		echo '<td>'.$file.'</td>';<br />
		echo '<td>'.filesize($dirfile).'</td>'; <br />
		echo '<td>'.filetype($dirfile).'</td>';<br />
		echo '<td>'.date('Y/n/t',filetime($dirfile)).'</td>';<br />
		echo '</tr>';<br />
	}<br />
	echo '</table>';<br />
	closedir($dir_handle);<br />
	echo '在<b>'.$dirname.'</b>目录下的子目录和文件共有<b>'.$num.'</b>个';
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template