Created
October 16, 2015 12:39
-
-
Save melice/7d19e649bbb1fe9ffaba to your computer and use it in GitHub Desktop.
This file contains 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 | |
$handle = fopen("http://www.youseeme.com/bi/m/api/save/todata3.json", "rb"); | |
$result = stream_get_contents($handle); | |
fclose($handle); | |
$data = json_decode($result, true); | |
$keys = array_keys($data[0]); | |
echo '<table class="dataintable">'; | |
echo "<tr>"; | |
foreach ($keys as $k) | |
{ | |
echo "<th> $k </th>"; | |
} | |
echo "</tr>"; | |
foreach ($data as $d) | |
{ | |
echo "<tr>"; | |
foreach ($keys as $k) | |
{ | |
echo "<td> ".$d[$k]." </td>"; | |
} | |
echo "</tr>"; | |
} | |
echo "</table>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment