找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 884|回复: 6

[iptv信源 资源分享或寻求] 求助下php这个写法怎么打印不出来数据源

[复制链接]
发表于 2022-5-15 22:25 | 显示全部楼层 |阅读模式
<?php
$id = isset($_GET['id'])?$_GET['id']:'ynws';
$n = array(
'ynws' => 5bbc5e0ea0da3b0b9b74d43a,//云南卫视
);
$data = file_get_contents('https://cloudxyapi.yunshicloud.com/api/xy/toc/v1/queryLivePage?labelName=%E7%94%B5%E8%A7%86&companyId=ysxw&currentPage=1&pageNum=100');
$json = json_decode($data);
for($i=0;$i<10;$i++){
   if($n[$id] == $json -> data -> results-> lives[$i] -> channelId){
      $playurl =  $json -> data -> results-> lives[$i] -> stream;
   };  
}
print_r($playurl);
?>

我的恩山、我的无线 The best wifi forum is right here.
发表于 2022-5-15 22:37 | 显示全部楼层
  1. 'ynws' => '5bbc5e0ea0da3b0b9b74d43a',//云南卫视
复制代码
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-5-15 22:57 | 显示全部楼层
<?php
$id = isset($_GET['id'])?$_GET['id']:'ynws';
$n = array(
'ynws' => '5bbc5e0ea0da3b0b9b74d43a',//云南卫视
);
$data = file_get_contents('https://cloudxyapi.yunshicloud.com/api/xy/toc/v1/queryLivePage?labelName=%E7%94%B5%E8%A7%86&companyId=ysxw&currentPage=1&pageNum=100');
$json = json_decode($data);
for($i=0;$i<10;$i++){
   if($n[$id] == $json -> data -> results[$i]-> lives[0] -> channelId){
      $playurl = $json -> data -> results[$i]-> lives[0] -> stream;
   };  
}
print_r($playurl);
?>

点评

换了个浏览器就好了,谢谢  详情 回复 发表于 2022-5-16 17:01
十分感谢,但是我用浏览器打开怎么是空白  详情 回复 发表于 2022-5-15 23:12
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2022-5-15 23:12 | 显示全部楼层

十分感谢,但是我用浏览器打开怎么是空白
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-5-16 00:01 | 显示全部楼层
yf1197565391 发表于 2022-5-15 23:12
十分感谢,但是我用浏览器打开怎么是空白

刚试了下我这里浏览器页可以呀
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2022-5-16 17:01 | 显示全部楼层

换了个浏览器就好了,谢谢
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-5-16 23:54 | 显示全部楼层
<?php

$data = file_get_contents('https://cloudxyapi.yunshicloud.com/api/xy/toc/v1/queryLivePage?labelName=%E7%94%B5%E8%A7%86&companyId=ysxw&currentPage=1&pageNum=100');
$json = json_decode($data, true);
foreach($json['data']['results'] as $key => $value)
{
    echo $value['roomName'].PHP_EOL;
    foreach($value['lives'] as $lives => $live)
    {
        echo $live['stream'].PHP_EOL;
    }
}
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-3-29 15:16

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表