This question already may asked here but i tried search couldn't find it I have Json data like below
{"CityInfo":[{"CityCode":"5599","Name":"DRUSKININKAI"},{"CityCode":"2003","Name":"KAUNAS"},{"CityCode":"2573","Name":"KLAIPEDA"},{"CityCode":"1692","Name":"VILNIUS"}],"StartTime":"2016-11-05 07:20:34","EndTime":"2016-11-05 07:20:34"}
i tried to extract these using php and inserted to mysql db. but its not work for me as i beginner in coding please help to solve this
Below I tried
$jsondata = file_get_contents($jsonFile);
$data = json_decode($jsondata, true);
echo $data['Name'];
echo $data['CityCode'];
$db->save($data, "tableName"); // i found a php app to insert json to db