I'm using an API which returns a JSON. here is the link to JSON http://getpincodes.info/api.php?pincode=421305 this is oupput json of above link [{"pincode":"421305","city":"Vidyashram","district":"Thane","state":"MAHARASHTRA"}] here is my code to read data:
$json = file_get_contents("http://getpincodes.info/aenter code herepi.php?pincode=$zip");
$data=json_decode($json);
$city = $data->city;
echo $city;
enter code here
i m getting the error while doing so Notice: Trying to get property of non-object in