I get the following data in JSON format.
{"Students":
[{"ID":"600","datetime":"26-11-2019 04-32-31","age":"12"},
{"ID":"601","datetime":"26-11-2019 04-32-31","age":"13"},
{"ID":"602","datetime":"26-11-2019 04-32-31","age":"12"},
{"ID":"603","datetime":"26-11-2019 04-32-31","age":"14"}
]}
I want to write a PHP script to insert this data in MYSQL.
I'm not sure how to write the Loop to go through this data.
I tried the following code, and it does not work.
//encode the Json request.
$obj = json_decode($content);
foreach($obj as $key){
// $email = $decode['RouteID'];
}
$key