我有下一个字符串:
String = "Name: James, Training, Physician, Hobbies: Sports, Reading, Age: 24".
使用以下字符串与第一个'分享:'发现,做出以下结论:
stringsplit1 = "Name";
stringsplit2 = "James, Training, Physician, Hobbies: Sports, Reading, Age: 24";
或在数组中。 :S
答案 0 :(得分:1)
explode(':',$string,2);
^ ------------> limit [int]
完整代码:
$string = "Name: James, Training, Physician, Hobbies: Sports, Reading, Age: 24";
$ar = explode(":",$string,2);
print_r($ar);