繁体   English   中英

PHP通过file_get_content()获得价值

[英]PHP get value with file_get_content()

我想从此页面获取“文件” m3u8“查看源: http ://www.freelivestream.tv/embedPlayer.php?file=cartoon”

我正在尝试此代码,但没有获得所有赋予的价值,请提供任何帮助

    <?php

$url = "http://www.freelivestream.tv/embedPlayer.php?file=cartoon";
$contents = file_get_contents($url);

preg_match('@m3u8([^"]+)@',$contents,$filo);
$filo = urldecode($filo[0]);



echo $filo;


?> 

我想得到这样的东西:http: //95.141.32.136 : 8081/edge/cartoon/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9OS8xOS8yMDE3IDEyOjE4OjEyIFBNJmhhc2hfdmFsdWUZB3ZeKnB1ZeBzDzDzDzDzDzDzDzDzDyzDzDzDzDzDzDzDz

但使用我的代码,它只给出了:m3u8?

谢谢

使用以下代码:

$url = "http://www.freelivestream.tv/embedPlayer.php?file=cartoon";
$contents = file_get_contents($url);

preg_match('/"(.*)m3u8(.*)"/',$contents,$filo);
$filo = urldecode($filo[0]);

echo $filo;

希望这会有所帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM