How can I get the fragment (value after hash '#') from a URL in php?
Say from http://domain.com/site/gallery/1#photo45
I want photo45
How can I get the fragment (value after hash '#') from a URL in php?
Say from http://domain.com/site/gallery/1#photo45
I want photo45
That part is called "fragment" and you can get it in this way:
I've been searching for a workaround for this for a bit - and the only thing I have found is to use URL rewrites to read the "anchor". I found in the apache docs here http://httpd.apache.org/docs/2.2/rewrite/advanced.html the following...
It may have other caveats and what not ... but I think that at least doing something with the # on the server is possible.
I found this trick, if u insist want the value with php.. split the anchor (#) value and get it with javascript, then store as cookie, after that get the cookie value with php~
http://www.stoimen.com/blog/2009/04/15/read-the-anchor-part-of-the-url-with-php/