📌  相关文章
📜  $_server 'remote_addr' 无法正常工作 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:42.256000             🧑  作者: Mango

代码示例1
if(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
    $ip_address = $_SERVER['REMOTE_ADDR'];
}