我的代码是
$data = "met with a good salesperson in sunway carnival. her name is Katie Hopkins, manager of Marketing & Sales. Her mobile phone is 0165531477.
And then, met with Katie Holmes, her mobile phone is 0123456777.";
echo preg_match('\h*(\d+)',$data);
我想从字符串$data
中检索特定信息,然后将人员名称分配到数组$name[]
,并将他们的手机分配到数组$mobile[]
。以下是示例,但我不知道如何进行PHP编码以将人名和手机号码输入特定阵列。
$name[0] = 'Kean Teck';
$mobile[0] = '0165531477';
$name[1] = 'Katie Hopkins';
$mobile[1] = '0123456777';