menu
more_vert

php-ip

作者:dayu

    function get_client_ip(){
        $headers = array(‘HTTP_X_REAL_FORWARDED_FOR‘, ‘HTTP_X_FORWARDED_FOR‘, ‘HTTP_CLIENT_IP‘, ‘REMOTE_ADDR‘);
        foreach ($headers as $h){
            $ip = $_SERVER[$h];
            // unknown
            if ( isset($ip) && strcasecmp($ip, ‘unknown‘) ){
                break;
            }
        }
        if( $ip ){
            list($ip) = explode(‘, ‘, $ip, 2);
        }
        return $ip;
    }

  

php-ip

原文地址:http://www.cnblogs.com/Crius/p/7244271.html



Processed Time:0.22642803192139

_REQUEST:
Array
(
    [0] => read
    [1] => 94288
)
_SESSION:
Array
(
    [fid] => 4
)