The string:
user:hello,user2:world
Desired Output:
$string = array(
1 => array( 1 => "user", 2 => "hello"),
2 => array( 1 => "user2", 2 => "world")
);
What I've tried (that doesn't work):
$string = explode(',',$string);
$string = explode(':',$string);
The error I get: explode() expects parameter 2 to be string
How can I get from the string to the desired output? Thanks!