【发布时间】:2020-10-10 14:16:42
【问题描述】:
我有这个 PHP 代码可以从名为 stream.php 的页面获取流 URL:
$url = file_get_contents("stream.php");
preg_match('#src="(.*?)"#', $url, $getm3u8);
echo ($getm3u8[1]);
在 stream.php 我有这个:
<source src="http://domaine.com/test1/playlist.m3u8" type="video/mp4">
<source src="http://domaine.com/test2/playlist.m3u8" type="video/mp4">
<source src="http://domaine.com/test3/playlist.m3u8" type="video/mp4">
此代码echo ($getm3u8[1]); 返回第一个网址“http://domaine.com/test1/playlist.m3u8”
如何获取其他 2 个网址?
【问题讨论】:
标签: php file-get-contents