<?php
//解决中文乱码
header("Content-Type: text/html;charset=utf-8");
//获取客户端IP
$getip=$_SERVER["REMOTE_ADDR"];
//API获取详细信息
$url=file_get_contents('http://opendata.baidu.com/api.php?query='.$getip.'&co=&resource_id=6006&t=1412300361645&ie=utf8&oe=gbk&cb=op_aladdin_callback&format=json&tn=baidu&cb=jQuery1102026811896078288555_1412299994977&_=1412299994981'); 
//输出
$url = iconv("gb2312", "utf-8//IGNORE", $url);  
echo $url;
?>