$p = '/(\w+\s\w+)/';//加括號(hào),$match有兩個(gè)$n ='/\w+\s\w+/';//不加括號(hào),$mctch有就只有一個(gè)$str = "name:steven jobs";preg_match($p, $str, $match);preg_match($n, $str, $mctch);print_r($match);echo "<br/>";print_r($mctch);Array ( [0] => steven jobs [1] => steven jobs )?Array ( [0] => steven jobs )
- 2 回答
- 0 關(guān)注
- 3270 瀏覽
添加回答
舉報(bào)
0/150
提交
取消