so am trying to save the feed am getting from a url and writing it to a file called new.json. after writing the feed to the file, i then use the json_decode function to store the information but am unable to retrieve the information. i know the code works because i've tested it with another file and it works but the file is jus 6.45KB and the new.json file is over 3MB.
i need the data from the url to update a database, but am unable to because it jus wont produce the information from the file, so am wondering if the file is too large.
thanks.
$new_props = $property->getData($URL); //Set Method to retrieve property
$file = fopen("new.json","w+")or die("Error opening output file");
echo fwrite($file,json_encode($new_props));
fclose($file);
$ourFileName = "new.json";
$mydata = file_get_contents($ourFileName);
$json_array = json_decode($mydata, TRUE);
if (is_null($json_array)) {
echo'<br /> json decode failed. Error handling here. <br />';
}
$id = $json_array[property][1][id];
$area = $json_array[property][1][area];
echo "<br /> id:".$id ."<br /> area:".$area;