It works
$url = parse_url('http://yabadaba.com/brand#asos');
echo $url['fragment'];
But it doesn't work
$url = parse_url($_SERVER['REQUEST_URI']);
echo $url['fragment'];
What is wrong? :(
It works
$url = parse_url('http://yabadaba.com/brand#asos');
echo $url['fragment'];
But it doesn't work
$url = parse_url($_SERVER['REQUEST_URI']);
echo $url['fragment'];
What is wrong? :(
That is because the parameter preceded by #
will not reach the server-side script. You can get it only by Javascript.
parse_url
function.