How To Get List Array PHP Json

Sample data JSON:

<php
$get_url='{
"countries": [
{
"name": "United States of America",
"code": "US",
"city": "New York"
},
{
"name": "India",
"code": "IN",
"city": "New Delhi"
},
{
"name": "China",
"code": "CN",
"city": "Beijing"
},
{
"name": "Germany",
"code": "DE",
"city": "Berlin"
},
{
"name": "Kenya",
"code": "KE",
"city": "Nairobi"
}
]
}';

OK, Get data json to PHP list View by all sub Counties

$data = json_decode($get_url)->countries;
foreach($data as $tmp){
echo "Country: ".$tmp->name."<br>";
echo "Code: ".$tmp->code."<br>";
echo "City: ".$tmp->city."<hr>";
}
READ :  PHP Variabel, echo and print / PHP Dasar