I am trying to parse a string in JSON, but not sure how to go about this. This is an example of the string I am trying to parse into a PHP array.
$json = \'{
It can be done with json_decode(), be sure to set the second argument to true because you want an array rather than an object.
true
$array = json_decode($json, true); // decode json
Outputs:
Array ( [id] => 1 [name] => foo [email] => foo@test.com )