php - How to use an API to generate a table? -
there's game i'm interested in making widget-type table on website. have public api "invasions
", located here
i'm looking generate table using info provide. there number of websites utilize api , generate table info, such website
i know how create tables generated mysql data.
however, i've never made table generated info api.
is there guide somewhere, or me started?
thanks much!
something work. set , style it/ construction require it.
$url = "https://www.toontownrewritten.com/api/invasions"; $data = json_decode(file_get_contents($url)); print "<table>"; foreach ($data->invasions $title => $inv) { print "<tr>"; print "<td>{$title}</td><td>{$inv->progress}</td><td>{$inv->asof}</td>"; print "</tr>"; } print "</table>";
you alternatively utilize curl
run http request fetch data. exclusively how implement this.
php html api table html-table
No comments:
Post a Comment