📜  获取请求 symfony 的来源 - PHP 代码示例

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

代码示例1
if (array_key_exists('HTTP_ORIGIN', $_SERVER)) {
    $origin = $_SERVER['HTTP_ORIGIN'];
}
else if (array_key_exists('HTTP_REFERER', $_SERVER)) {
    $origin = $_SERVER['HTTP_REFERER'];
} else {
    $origin = $_SERVER['REMOTE_ADDR'];
}