file_get_contents遍历api数据
生活随笔
收集整理的這篇文章主要介紹了
file_get_contents遍历api数据
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
使用【bootstrap】框架
關(guān)鍵代碼:
file_get_contents("API路徑");
<table class="table table-hover table-bordered table-striped" style="text-align: center;"><tr style="background-color: #F6F9FE;"><th>編號(hào)</th><th>標(biāo)題</th><th>路徑</th><th>狀態(tài)</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>?
總結(jié)
以上是生活随笔為你收集整理的file_get_contents遍历api数据的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql使用Navicat创建分区
- 下一篇: js_jQuery综合机试练习题