Is there a PHP variable which contains either the whole URL including the fragment or a variable that holds the fragment?
Fragment: The part of the URL after the # eg:
http://blah.com/page.php#faq
----------------------------------^^
Thanks.
URL with fragment?
Moderator: General Moderators
Ok. The current script's url should be in the $_SERVER variables http://nl2.php.net/manual/en/reserved.variables.php
I think you'd want 'REQUEST_URI'
and after that use the parse_url function to get the fragment.
I think you'd want 'REQUEST_URI'
and after that use the parse_url function to get the fragment.
Nope.
It's not in there either.
Note: I'm using print_r on it:
It's not in there either.
Note: I'm using print_r on it:
Code: Select all
<?php
$og = parse_url($_SERVER['REQUEST_URI']);
print_r($og);
?>