20,359
社区成员
发帖
与我相关
我的任务
分享
<html>
<?php
function getIpPlace(){
$ip=file_get_contents("http://fw.qq.com/ipaddress");
$ip=str_replace('"',' ',$ip);
$ip2=explode("(",$ip);
$a=substr($ip2[1],0,-2);
$b=explode(",",$a);
return $b;
}
$ip=getIpPlace();
?>
<div align="center">{if $ip[2]=="浙江省"}{$ip[2]}{/if}</div>
</html>
<?php
if ( $ip[2]=="浙江省" ) echo $ip[2];
?>