When I'm trying to decode the JSON string to the array, it decodes only one entry from the entire string.
public function GetAllCommunities() {
$json_url = "URL";
$json_name = "NAME";
$returnArray = null;
$curl_init = curl_init();
curl_setopt($curl_init, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_init, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_init, CURLOPT_URL, $json_url);
$result = curl_exec($curl_init);
curl_close($curl_init);
//print_r($result);
$jsonArray2 = json_decode($result, true);
print_r($jsonArray2);
}
When I print_r the result, I get all the data, but when I do decode the json_decode($result, true);, I get only 1 entry from the entire feed.
Any idea why? Could this mean there's error in the feed?
I have nested JSONs there, and I'm checking their correctness by using this: http://json.parser.online.fr/
Thanks.
Communityrepeated several times. Check here: jsonlint.com