解析代码
$str = 'My name is Michael. I am a sportsman!';
preg_match('|My name is (.*?)\. I am a (.*?)|', $str, $m);
print_r($m);
返回我字符串:
Array ( [0] => My name is Michael. I am a [1] => Michael [2] => )
在哪里sportsman
?
解析代码
$str = 'My name is Michael. I am a sportsman!';
preg_match('|My name is (.*?)\. I am a (.*?)|', $str, $m);
print_r($m);
返回我字符串:
Array ( [0] => My name is Michael. I am a [1] => Michael [2] => )
在哪里sportsman
?