首页 > 解决方案 > file_get_contents 并删除特殊字符

问题描述

<?php
$streamSite = "http://testsite.com/token.php";
function writeFile($url, $channel) {
$File = $channel.".strm";
$Handle = fopen($File, 'w');
fwrite($Handle, $url);
fclose($Handle);
}
$input = @file_get_contents($streamSite) or die("Please try again later: $url");
preg_match('/(m3u8.*hdnea=.*acl=.*~hmac=.*)/', $input, $matches);

echo $matches[1];


?> 

;

输出,但由于这个原因它不起作用'); 谁能帮我删除这个'); 形成下面的 outfile 链接。谢谢 https://test.com/i/xxxx/master.m3u8hdnea=st=xxxxx~exp=xxxxxx~acl=/ *~hmac=xxxxxx');

标签: phpcharactertoken

解决方案


推荐阅读