php - Parse data from string "name:john email:john@example.com id:123456" -
basically, want access data between substrings (between "name:" , "email:", example)
what's best way of doing this?
you can first explode on space...
$array = explode(' ',$string);
and explode on : while looping through....
foreach($array $arr){ $temp = explode(':',$arr); echo $temp[1]; // value here }
Comments
Post a Comment