PHP preg_match()函数

preg_match() 函数用于进行正则表达式匹配,成功返回 1 ,否则返回 0 。
preg_match() 匹配成功一次后就会停止匹配,如果要实现全部结果的匹配,则需使用 preg_match_all() 函数。
preg_match (pattern , subject, matches)
pattern    正则表达式
subject    需要匹配检索的对象
matches    可选,存储匹配结果的数组