我想知道是否有任何方法可以在PHP中创建解析器,从而从该站点获取值https://btc-e.com/api/2/btc_usd/ticker
并将其设置为php代码中的变量?
我稍微看过php解析器,发现的唯一一件事就是解析器回显了网站上的所有信息。
由于该URL返回JSON
响应:
<?php
$content=file_get_contents("https://btc-e.com/api/2/btc_usd/ticker");
$data=json_decode($content);
//do whatever with $data now
?>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句