<?php
$id = $_GET['id'];
$bstrURL = 'http://toutiao.cnwest.com/sxtoutiao/getOnlineList';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $bstrURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, 'okhttp/3.14.4' );
$data = curl_exec($ch);
curl_close($ch);
//$json = json_decode($data);
/*
//输出频道表
foreach($json->data as $out)
{
echo ($out->id.','.$out->onlineName.','.$out->onlineUrlForandroid.'<br />');
}
exit();
*/
preg_match('/"id":'.$id.',.*?"onlineUrlForandroid":"(.*?)",/i',$data,$ma);
$url = str_replace('','',$ma[1]);
header('location:'.$url);
?>
4,陕西卫视
7,农林卫视
1,新闻资讯频道
2,都市青春频道
3,生活频道
5,公共频道
9,体育休闲频道
版权说明
文章采用: 《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权。版权声明:未标注转载均为本站原创,转载时请以链接形式注明文章出处。如有侵权、不妥之处,请联系站长删除。敬请谅解!