dd
IP地址

获取客户端IP地址

jerry thinkphp
获取客户端IP地址 $type表示返回类型 0 返回IP地址 1 返回IPV4地址数字function get_client_ip($type = 0) {     $type       =  $type ? 1 : 0;     static $ip  =   NULL;   ...
阅读全文

通过IP获取对应ip的城市信息的函数

jerry thinkphp
通过IP获取对应ip的城市信息的函数/**  * 通过IP获取对应城市信息(该功能基于淘宝第三方IP库接口)  * @param $ip IP地址,如果不填写,则为当前客户端IP  * @return  如果成功,则返回数组信息,否则返回false  *