使用【bootstrap】框架

关键代码:

file_get_contents("API路径");

<table class="table table-hover table-bordered table-striped" style="text-align: center;">
<tr style="background-color: #F6F9FE;">
<th>编号</th>
<th>标题</th>
<th>路径</th>
<th>状态</th>
</tr>
<?php
$file_contents = file_get_contents("http://127.0.0.1:7777/blog/public/columns/FindAll");
$arr=json_decode($file_contents,true);
for($i=0;$i<count($arr);$i++) {
?>
<tr>
<td><?php echo $arr[$i]['id']; ?></td>
<td><?php echo $arr[$i]["title"]?></td>
<td><?php echo $arr[$i]["url"]?></td>
<td><?php echo $arr[$i]["state"]?></td>
</tr>
<?php
}
?>
</table>

file_get_contents遍历api数据_php