Edit File by line
/home/barbar84/public_h.../extracte.../dirfunc
File: common.func.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* 提示操作信息的,并且跳转
[3] Fix | Delete
* @param string $mes
[4] Fix | Delete
* @param string $url
[5] Fix | Delete
*/
[6] Fix | Delete
function alertMes($mes,$url){
[7] Fix | Delete
echo "<script type='text/javascript'>alert('{$mes}');location.href='{$url}';</script>";
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* 截取文件扩展名
[12] Fix | Delete
* @param string $filename
[13] Fix | Delete
* @return string
[14] Fix | Delete
*/
[15] Fix | Delete
function getExt($filename){
[16] Fix | Delete
return strtolower(pathinfo($filename,PATHINFO_EXTENSION));
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* 产生唯一名称
[21] Fix | Delete
* @param int $length
[22] Fix | Delete
* @return string
[23] Fix | Delete
*/
[24] Fix | Delete
function getUniqidName($length=10){
[25] Fix | Delete
return substr(md5(uniqid(microtime(true),true)),0,$length);
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
[29] Fix | Delete
[30] Fix | Delete
[31] Fix | Delete
[32] Fix | Delete
[33] Fix | Delete
[34] Fix | Delete
[35] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function