The hash part of the URL (the # and everything after) isn't sent by the browser to the server, so it's not available to PHP.
If you absolutely need your server side to be aware of it, the only way is to load an intermediate page containing Javascript that reads the hash value, and makes another request where the value is contained in a regular HTTP parameter. E.g. the intermediate page could be something like: