Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Récupérer la racine du referer
function racine_referer()
if (!isset($_SERVER['HTTP_REFERER'])){
return false;
$parser_url = parse_url(trim($_SERVER['HTTP_REFERER']));
return trim($parser_url[host] ? $parser_url[host] : array_shift(explode('/', $parser_url[path], 2)));
echo racine_referer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment