使用php 检测 http3913424161dbiptvsnchinamobilecomPLTV88888890224322122$idindexm3u8; $id=0000-9999 是否正常访问
可以使用以下代码来检测:
$id = "1234"; // 替换成需要检测的id
$url = "http://39.134.24.161/dbiptv.sn.chinamobile.com/PLTV/88888890/224/322122".$id."/index.m3u8";
$headers = get_headers($url);
$status = substr($headers[0], 9, 3);
if ($status == "200") {
echo "URL is accessible";
} else {
echo "URL is not accessible";
}
该代码会使用 get_headers 函数获取该URL的响应头,然后检查 HTTP 状态码是否为 200。如果是,则说明该URL可以正常访问。如果不是,则说明该URL不可访问。
原文地址: http://www.cveoy.top/t/topic/fp4a 著作权归作者所有。请勿转载和采集!