How to parse URL fragment identifier

You can’t since those are never passed to the server. For PHP use the authorization code flow.