簡體   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