标签:
<?php $str = ‘php is the best language phhhhp is‘; $part = ‘/ph{1,}p/‘; echo preg_match($part, $str,$ar1); var_dump($ar1); echo preg_match_all($part, $str,$ar); var_dump($ar); echo $ar[0][0];
1 array 0 => string ‘php‘ (length=3) 2 array 0 => array 0 => string ‘php‘ (length=3) 1 => string ‘phhhhp‘ (length=6) php
php 函数preg_match、preg_match_all ,以及正则表达式规则
标签:
原文地址:http://www.cnblogs.com/lola/p/5437088.html