2024-07-09 08:02:55
<?php
header("content-type: text/html; charset=UTF-8");
$connect = curl_init("http://city.ip138.com/ic.asp");
//curl_setopt($connect, CURLOPT_SSL_VERIFYPEER, FALSE);
//curl_setopt($connect, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($connect, CURLOPT_HEADER, FALSE);
curl_setopt($connect, CURLOPT_RETURNTRANSFER, TRUE);
$respond = curl_exec($connect);
$respond = iconv("GB2312", "UTF-8", $respond);
if(preg_match_all('/[^\x4e00-\x9fa5]+/u', $respond, $isp)) {
$result = explode(':', $isp[0][26])[1];
echo $result;
}else {
echo "Not Found";
}
?>
使用这个出错,
Parse error: syntax error, unexpected '[' in D:\syset\ip0.php on line 20
2024-07-09 11:47:03
不好意思,字节超出所以才转为图片
....你还是没有回答我,你到底有没有试过我写的代码???