嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 4 元微信扫码支付:4 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
利用php实现了网页模板抓取
参考网址:http://schoolbuy.net/gm/index.php
<?php
error_reporting(0);
/**
* 读取文件
* @param string $filename 路径
* @param bool $isarray 为true则返回array
* @return string/array
*/
function read($filename) {
return file_exists($filename) ? include $filename : array();
}
/**
* 写入文件
* @param string $file 路径
* @param string/array $content 为数组则以return array形式存放
*/
function write($file, $content) {
if (is_array($content)) {
$content = '<?php return ' . var_export($content, 1) . '?>';
}
file_put_contents($file, $content);
}
function rdv($start=0)
{
$config = read($GLOBALS["cfg"]);
return array_slice($config,intval($start));
}
function adv($value)
{
$GLOBALS["array"][] = $value;
write($GLOBALS["cfg"],$GLOBALS["array"]);
}
if(isset($_GET["url"]))
{
$bu=urldecode($_GET["url"]);
$inf=parse_url($bu);
$GLOBALS["cfg"]=$inf["host"]."/config.php";
if(isset($_GET['query']) && is_numeric($_GET['query']))
{
echo json_encode(rdv($_GET['query']));
exit;
}
}
?>