怎么通过php取以下接口中的指定内容呢?
phpcn_u290
phpcn_u290 2016-12-26 21:50:49
0
4
1603
phpcn_u290
phpcn_u290

reply all(4)
数据分析师

How to get the specified content in the following interface through php? -PHP Chinese website Q&A-How to get the specified content in the following interface through php? -PHP Chinese website Q&A

Please watch and learn.

Ty80

截图:QQ截图20161226223859.jpg

Ty80

<?php

$url="http://interface.yy.com/hls/get/0/54880976/54880976?appid=0&excid=1200&type=m3u8&callback=jsonp2";

$data=str_replace('})','}',str_replace('jsonp2({','{',file_get_contents($url)));

$json=json_decode($data,true);

$str=$json["hls"];

echo $str;

exit;


Ty80

那是jsonp接口,建议使用js接收,可以在js中定义个jsonp2函数,json数据就是参数。


  • reply 谢谢!学习了!
    phpcn_u290 author 2016-12-27 13:10:43
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template