Created
March 18, 2020 08:43
-
-
Save abaykan/adcbb07952f1435ace10d815f3f91799 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$api = file_get_contents('https://api.kawalcorona.com/'); | |
?> | |
<table border=1> | |
<tr> | |
<th>Country</th> | |
<th>Confirmed</th> | |
<th>Deaths</th> | |
<th>Recovered</th> | |
<th>Active</th> | |
</tr> | |
<?php | |
foreach (json_decode($api, TRUE) as $key => $value) { | |
echo ' | |
<tr> | |
<td>'.$value['attributes']['Country_Region'].'</td> | |
<td>'.$value['attributes']['Confirmed'].'</td> | |
<td>'.$value['attributes']['Deaths'].'</td> | |
<td>'.$value['attributes']['Recovered'].'</td> | |
<td>'.$value['attributes']['Active'].'</td> | |
</tr> | |
'; | |
} | |
?> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment