A function that gets IP address

xiaoxiao2021-03-06  56

Function getip ()

{

IF (GetENV ('http_client_ip'))

{

$ onlineIP = getenv ('http_client_ip');

}

Elseif (GetENV ('Remote_addr'))

{

$ onlineIP = getenv ('remote_addr');

}

Else

{

$ onlineIP = $ _server ['remote_addr'];

}

Return $ onlineIP;

}

$ ip = getip ();

ECHO $ ​​IP;

?>

转载请注明原文地址:https://www.9cbs.com/read-113433.html

New Post(0)