This notice show up in my localhost. For the first
data -> name
there is no problem displaying but the second data can not be display.
This is the code that I write, for some reason I have tried this code below but still not solve my problem.
$phase1 = $parsed_json->phases->phase1;
and also i tried
$phase1 = $parsed_json->{'phases'}->{'phase1'};
This is my code currently
<?php
$json = '{
"name": "MCO",
"phases": [
{"phase1": "18-Mac-2020"},
{"phase2": "1-April-2020"}
]
}';
$parsed_json = json_decode($json);
$name = $parsed_json->name;
$phase1 = $parsed_json->phases->phase1;
echo "Name: ".$name."<br/>";
echo "Phase 1: ".$phase1."<br/>";
?>