$p = '/(\w+\s\w+)/';//加括號,$match有兩個$n ='/\w+\s\w+/';//不加括號,$mctch有就只有一個$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 )
添加回答
舉報
0/150
提交
取消