I have the following JSON string, which was an Objective C array then encoded to JSON:
$jsonString=[\\\"a@gmail.com\\\",\\\"b@gmail.com\\\",\\\"c@gmail.com\
$str=<<<H
{"a":"AAA","b":"333"}
H;
$object = json_decode($str);
$array = json_decode($str , 1 );
// $arr = get_object_vars( json_decode($str) );
This code works fine.
$jsonString = '["m@gmail.com","b@gmail.com","c@gmail.com"]';
$arrayOfEmails=json_decode($jsonString);
$arrayOfEmails=(array)json_decode($jsonString);
print_r($arrayOfEmails);
Try this:
json_decode($json_string, true);