Reputation: 185
I have string like this:
(17:1)(1:0)(5:0)
How can I get to array like this:
Array (
[0] => 17:1
[1] => 1:0
[2] => 5:0
)
Upvotes: 1
Views: 174
Reputation: 185
My solution (preg_split):
$result = preg_split("/\)/", str_replace("(","",substr($mystring,0,-1)));
Thanks to Casimir et Hippolyte for explode example:
$result = explode(')(', trim($str, '()'));
Upvotes: 1