存档

文章标签 ‘PHP’

php最常用的最有作用的函数

2012年1月29日 没有评论

tempnam 生成唯一文件名

tempnam('./yzm/tmpimage','cookie');//生成唯一文件名

array_values 重建数组索引

file_exists 判断文件是否存在,文件要使用绝对路径

var_dump 输出出变量


$cookie_file = dirname(__FILE__)."/yzm/tmpimage/emscookie";
var_dump(file_exists($cookie_file))
未完待续...

分类: 杂谈 标签: ,

php正则匹配简明

2011年11月25日 没有评论
. Any character except newline.
\. A period (and so on for \*, \(, \\, etc.)
^ The start of the string.
$ The end of the string.
\d,\w,\s A digit, word character [A-Za-z0-9_], or whitespace.
\D,\W,\S Anything except a digit, word character, or whitespace.
[abc] Character a, b, or c.
[a-z] a through z.
[^abc] Any character except a, b, or c.
aa|bb Either aa or bb.
? Zero or one of the preceding element.
* Zero or more of the preceding element.
+ One or more of the preceding element.
{n} Exactly n of the preceding element.
{n,} n or more of the preceding element.
{m,n} Between m and n of the preceding element.
??,*?,+?,
{n}?, etc.
Same as above, but as few as possible.
(expr) Capture expr for use with \1, etc.
(?:expr) Non-capturing group.
(?=expr) Followed by expr.
(?!expr) Not followed by expr.

在线php正则检测 http://regexpal.com/

分类: PHP, 网站 标签: ,

parse error, unexpected T_FUNCTION错误

2010年9月2日 没有评论

一般出现此错误,都是由于代码是从网页上拷贝来的,有一些非法空格字符。清除即可。

分类: PHP 标签:
普人特福的博客cnzz&51la for wordpress,cnzz for wordpress,51la for wordpress