![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PHP
sua_xu
这个作者很懒,什么都没留下…
展开
-
PHP 逻辑与(&&)妙用
$type ==4&&$result=2;全写if($type==4){ $result=2;}与之同样的写法$type==4||$result =2;if($type!=4){$result =2;}function getResult($type){$type==4||$r原创 2011-07-28 11:15:29 · 242 阅读 · 0 评论 -
PHP调试程序执行时间
PHP 获取程序调试时间function getmicrotime(){ list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec);}$begin=getmicr转载 2011-07-28 11:36:20 · 277 阅读 · 0 评论 -
PHP遍历文件夹
public function my_scandir($dir) { if(!is_dir($dir)) { return false; } $files = array(); $dir = realp原创 2011-07-28 10:06:24 · 177 阅读 · 0 评论 -
PHP获取IP
/** * 获取用户IP * @return $ip string */function get_ip() { if (getenv('HTTP_CLIENT_IP')) { $ip = getenv('HTTP_CLIENT_IP'); } elsei转载 2011-07-29 09:36:56 · 110 阅读 · 0 评论 -
PHP 转义
addslashes 默认的转义函数有单引号(')、双引号(")、反斜线(\)与 NUL(NULL 字符)。原创 2011-08-02 14:41:26 · 117 阅读 · 0 评论