/*
From:憧憬点滴记忆
Url:https://www.licoy.cn/2177.html
PS:转载请注明出处
*/
ini_set("max_execution_time",3000); //设置时间超时为3000秒。
header("Content-type: text/html; charset=utf-8");
//对汉字字符串进行单个分割
function mbStrSplit($string, $len=1) {
$start = 0;
$strlen = mb_strlen($string);
while ($strlen) {
$array[] = mb_substr($string,$start,$len,"utf8");
$string = mb_substr($string, $len, $strlen,"utf8");
$strlen = mb_strlen($string);
}
return $array;
}
//开始
function start_ch($c){
$c = iconv("utf-8","gb2312",$c);
$url = "http://www.52wubi.com/wbbmcx/tp/{$c}.gif";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$output = curl_exec($ch);
curl_close($ch);
file_put_contents("./".$c.".gif",$output);
}
$chinese = file_get_contents("./chinese.txt");
$chineseArr = mbStrSplit($chinese);
foreach($chineseArr as $key => $value){
start_ch($value);
}
echo "Download End";
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询