php模拟get提交 字符串截取 字符串替换 示例源码

180it 2020-02-15 PM 1916℃ 0条

php模拟get提交 字符串截取 字符串替换 示例源码
<?php
$qq = $_GET[qq]; //获取http://gxtest.sinaapp.com/get.php?qq=843516495网址的QQ参数843516495
$url = 'http://qun.594sgk.com/qq/'.$qq.'.html';//整理好网址http://qun.594sgk.com/qq/843516495.html
$data = file_get_contents($url);//模拟get提交http://qun.594sgk.com/qq/843516495.html
$data=substr($data, 5010);//字符串截取
$data=str_replace("594sgk.com", "", $data);//字符串替换
$data=str_replace(iconv("utf-8", "GBK", "一秒钟记住域名:我就是社工库(594sgk)"), "", $data);//字符串转换编码再替换
$data=str_replace(iconv("utf-8", "GBK", "来源于我就是社工库()"), "", $data);
$data=str_replace(iconv("utf-8", "GBK", "合作留言"), "", $data);
$data=str_replace("http://s22.cnzz.com/z_stat.php?id=1000125360&web_id=1000125360", "", $data);
$data=str_replace("../logo.gif", "", $data);
echo $data;
?>

支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

php模拟get提交 字符串截取 字符串替换 示例源码