php 获取移动端ip和pc端ip

来源:互联网 发布:java建立个人博客网站 编辑:程序博客网 时间:2024/06/06 07:52

1,获取pc端ip

$pc_ip=$_SERVER["REMOTE_ADDR"];

2,获取移动端ip

$file_contents = file_get_contents('http://pv.sohu.com/cityjson');

$logiName= explode('"',explode(':',$file_contents)[1])[1];

原创粉丝点击