摘要: $file = new SplFileInfo('foo-bar.txt'); print_r(array( 'getATime' => $file->getATime(), //最后访问时间 'getBasename' => $file->getBasename(), //获取无路径的basename 'getCTime' => $file->getCTime(),... 阅读全文
posted @ 2017-02-28 14:57 雨落知音 阅读(408) 评论(0) 推荐(0) 编辑
摘要: 防SQL注入 function clean($input) { if (is_array($input)) { foreach ($input as $key => $val) { $output[$key] = clean($val); } } else { $output = (string) $input; if (... 阅读全文
posted @ 2017-02-28 14:38 雨落知音 阅读(210) 评论(0) 推荐(0) 编辑
摘要: preg_replace() $msg = preg_replace("/和中间的部分 $msg = preg_replace("/]+>/", "", $msg); -----是删除和中间的内容 (PCRE_CASELESS) 如果设定此修正符,模式中的字符将同时匹配大小写字母。 s (PCRE_DOTALL) 如果设定了此修正符,模式中的圆点元字符(.)匹配所有的字符,... 阅读全文
posted @ 2017-02-28 14:22 雨落知音 阅读(175) 评论(0) 推荐(0) 编辑
摘要: PEAR 是“PHP Extension and Application Repository”的缩写,即PHP扩展和应用仓库。 PECL 是“PHP Extension Community Library”的缩写,即PHP 扩展库。PECL 可以看作PEAR 的一个组成部分。 str_spit 将字符串分隔成数组 输出:Array ( [0] => a [1] => b [2] ... 阅读全文
posted @ 2017-02-28 14:10 雨落知音 阅读(175) 评论(0) 推荐(0) 编辑