I'm trying to store a url such as:
http://localhost/pro%5Fprint/index.php#page=home
in a variable, but I can't find a function that does that. I found plenty of solutions to store the index.php, but it doesn't include the hashmark and what follows it. Is there a PHP solution for this?
I did see that I can get the full url including hashmark with javaScript using document.write(document.url)
or document.write(location.href)
but how do I store that into my variable? Is there any way I can combine PHP with javaScript in some sort of solution like this?
<?php $url ="?><script>document.write(document.url)</script><?php "?>