分类「PHP」的所有文章

PHP文件类型判断

function fileType($filename) { // 读取文件的前4个字节,根据硬编码判断 $file = fopen ( $filename, "rb" ); $strFile = fread ( $file, 4 ); //只读文件头4字节 fclose ( $file ); $strInfo = @unpack ( "C4chars", $strFile ); ...

PHP时间

<?php     date_default_timezone_set('PRC'); //默认时区     echo "今天:",date("Y-m-d",time()),"<br>";     echo "今天:",date("Y-m-d",strtotime("18 june 2008")),"<br>";     echo "昨天:",date("Y-m-d",strtotime("-1 day")), "<br>";     ech...