json veri çekme
4
●279
- 05-04-2020, 00:08:06<?php
$liste = json_decode(file_get_contents("https://www.sanalonay.com/evdekal/yeni.php"), true);
echo sprintf("<pre>%s</pre>", print_r($liste, true));
if(isset($liste['result'])) {
foreach($liste['result'] as $item) {
echo "{$item['country']}: {$item['totalDeaths']}<br/>";
}
}
?> - 05-04-2020, 00:21:09
<?php https://www.sanalonay.com/evdekal/yeni.php $fgc= file_get_contents("https://www.sanalonay.com/evdekal/yeni.php"); $json=json_decode($fgc,true); //print_r($json); for ($x = 0; $x <= 207; $x++) { echo "COUNTRY : ".$json["result"][$x]["country"]; echo "</br>totalCases : ".$json["result"][$x]["totalCases"]; echo "</br>newCases : ".$json["result"][$x]["newCases"]; echo "</br>totalDeaths : ".$json["result"][$x]["totalDeaths"]; echo "</br>newDeaths : ".$json["result"][$x]["newDeaths"]; echo "</br>totalRecovered : ".$json["result"][$x]["totalRecovered"]; echo "</br>activeCases : ".$json["result"][$x]["activeCases"]."<hr></br>"; } ?>