PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<? $url = "https://restcountries.com/v3.1/all"; $data = file_get_contents($url); $json = json_decode($data, true); $x = 1; foreach($json as $v){ if(isset($v['capital'])){ if(is_array($v['capital'])){ foreach($v['capital'] as $d){ echo $x." - ".$d."\n"; $x ++; } } } } #print_r($v);
Show:  
Copy Clear