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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -