sign签名
$sign = array(
'ip'=>'1.15.23.31'
// array('ip'=>'2.34.45.34'),
);
$ip = setSign($sign);
for ($i = 0; $i < count($ip); $i++)
{
$url = "http://hn216.api.yesapi.cn/".$ip;
$data = file_get_contents($url);
$data = json_decode($data,true);
$data = (array)$data;
$getErr[0] = $data['data']['err_code'] > 0 ? 'err':'ok';
$getErr[1] = empty($data['data']['data']) ? 'err':'ok';
if ($getErr[0]!'err'|| $getErr[1]!'err')
{
$setip[$i] = $data['data']['data']['country'].$data['data']['data']['region'];
if ($i > 0) {
$setips['loginip'] = $setip[1];
}
$setips['joinip'] = $setip[0];
}
}
if ($setips)
{
print_r($setips);
}