【发布时间】:2018-07-13 11:09:20
【问题描述】:
如何从这个 url 的 json 输出生成 html 表格?
http://megagrup.site/entegrasyon/hepsiburada.php
更新
我会找到这样的结果;
<?php
$json=file_get_contents("url");
$data = json_decode($json);
if (count($data->listings)) {
// Open the table
echo "<table>";
// Cycle through the array
foreach ($data->listings as $idx => $stand) {
// Output a row
echo "<tr>";
echo "<td>".$stand->abc."</td>";
echo "<td>".$stand->def."</td>";
echo "</tr>";
}
// Close the table
echo "</table>";
}
【问题讨论】:
标签: html json html-table