Answers for "php get ip user"

PHP
4

php get user ip

$ip = $_SERVER['REMOTE_ADDR'];
Posted by: Guest on July-05-2019
6

php get client ip

$_SERVER['REMOTE_ADDR']
Posted by: Guest on July-11-2020
1

get user ip in php

function getIp() {
    $ip = $_SERVER['REMOTE_ADDR'];
 
    if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
        $ip = $_SERVER['HTTP_CLIENT_IP'];
    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    }
 
    return $ip;
}
Posted by: Guest on December-17-2020

Browse Popular Code Answers by Language