【发布时间】:2014-11-29 04:48:06
【问题描述】:
我需要从以下字符串中提取名称:
$contact = "John96783819Dickson97863424"
我试过用这个:
preg_match('/[a-zA-Z]/',$contact,$matches);
但我得到了一个数组,其中所有字母都单独包含在数组中。
期望的输出:
Array ([0] => 'John', [2] => 'Dickson')
现在它变得复杂了。同样的雷鬼应该提取这个
$contact = 'Vincent Tan96123179Lawrence Thoo90603123Ryan Ong91235721' 进入这个
Array ([0] => 'Vincent Tan', [2] => 'Lawrance Thoo' , [3] => 'Ryan Ong')
我该怎么做?
【问题讨论】:
-
好的,找到了我的问题的答案。 [a-z A-Z]+ 可以解决问题