Skip to content

Instantly share code, notes, and snippets.

@abaykan
Created March 18, 2020 08:43
Show Gist options
  • Save abaykan/adcbb07952f1435ace10d815f3f91799 to your computer and use it in GitHub Desktop.
Save abaykan/adcbb07952f1435ace10d815f3f91799 to your computer and use it in GitHub Desktop.
<?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