Hello
I'm want to convert string to array
$str = "[cat=[0=php,script=[js]],id=4,foo=bar]";
how to write preg pattern
for change $str
to :
$str = "[cat=[0=php,script=[js]]_-_id=4_-_foo=bar]";
If convert ,
to _-_
I can convert this string to array by foreach
, but i can't convert ,
to _-_
in this string
I'm want convert only ,id=4,foo=bar
to _-_id=4_-_foo=bar
, No convert [0=php,script=[js]]
to [0=php_-_script=[js]]
have any idea?