I've a string like this:
$mystring = '{"1":"4","2":"2","3":"3"}';
I need to explode to something like this:
array(
"1" => "4",
"2" => "2",
"3" => "3"
)
I use php 5.4.
I've a string like this:
$mystring = '{"1":"4","2":"2","3":"3"}';
I need to explode to something like this:
array(
"1" => "4",
"2" => "2",
"3" => "3"
)
I use php 5.4.
you should use the json decode function, your string looks like json. The second argument tells to make it as an array, not an object.
json_decode($mystring, true);