php - List of objects -


what best method find parent items of comma separated string?

e.g.

array(1,2,3),array("test","123, abc"),1,"abc, 123" 

to get

array(1,2,3) array("test","123, abc") 1 "abc, 123" 

is possible regular expression, or there nifty php function this?

use explode.

$myarray = explode(",",$original); 

this assuming original string, , desired output can iterate through:

$original = 'array(1,2,3),array("test","123, abc"),1,"abc, 123"'; $myarray = explode(",",$original); foreach ($myarray $item) {   echo $item."\n"; } 

Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -