标签:
http://www.imooc.com/learn/350
preg_match 执行一个正则表达式匹配,只匹配一个结果
preg_match_all 执行一个全局正则表达式匹配,匹配全部符合规则的元素
$pattern 正则规则
$subject 匹配对象
$m1 匹配的结果
$pattern=‘/[0-9]/‘; $subject="bjd5454f121fff52"; $m1=array(); $t1=preg_match($pattern,$subject,$m1); print_r($t1); echo "<hr>"; print_r($m1);
$pattern=‘/[0-9]/‘; $subject="bjd5454f121fff52"; $m1=array(); $t1=preg_match_all($pattern,$subject,$m1); print_r($t1); echo "<hr>"; print_r($m1);
标签:
原文地址:http://www.cnblogs.com/xuyaoxiang/p/4448117.html