【发布时间】:2011-01-08 23:22:08
【问题描述】:
如何用php将json数据转成html?
$url="http://api.nytimes.com/svc/search/v1/article?format=json&query=usa&rank=newest&api-key=mykey"
当我在浏览器中输入网址时,它会返回
{"offset" : "0" , "results" : [{"body" : "A guide to cultural and recreational goings-on in and around the Hudson Valley. ...}]}
如何将 json body 数据放入 html?我的意思是这样echo '<div class="body"></div>';
【问题讨论】:
-
您从哪里调用 URL?客户端(JavaScript)还是服务器端(PHP)?
-
你的问题实在是太模糊了,能不能展开说一下?