醉菜鸟 2021-11-26 09:00:35

php获取当前请求的host

/** 
 * 当前请求的host 
 * @return string 
 */
function host(){    
    return $_SERVER['HTTP_X_REAL_HOST'] ?: $_SERVER['HTTP_HOST'];
}
意见反馈