0

I am experimenting with the Discord API which doesn't return querystring parameters and I can't use parse_url().

The URL looks like this: httpS://example.com/discord/#token_type=Bearer&access_token=TOKEN&expires_in=604800&scope=identify

Notice the #.

I would like to access the access_token, could someone point me in the right direction please?

M A
  • 59
  • 7
  • When you say _"I can't use `parse_url()`"_, is that because there is no query string in the URL or is it for some other reason? – Phil Mar 30 '20 at 23:30
  • 1
    Does this answer your question? [Get fragment (value after hash '#') from a URL in php](https://stackoverflow.com/questions/2317508/get-fragment-value-after-hash-from-a-url-in-php) – El_Vanja Mar 30 '20 at 23:30
  • @Phil Yes, there is no query string in the URL. – M A Mar 31 '20 at 00:05
  • [There](https://stackoverflow.com/questions/1032242/how-to-obtain-anchor-part-of-url-after-in-php) are [many](https://stackoverflow.com/questions/1917762/how-to-get-the-value-after-the-hash-in-somepage-phpname) duplicates [of](https://stackoverflow.com/questions/940905/can-i-read-the-hash-portion-of-the-url-on-my-server-side-application-php-ruby) this [here](https://stackoverflow.com/questions/967649/get-entire-url-including-query-string-and-anchor/967659). It can be hard to come up with the right search terms, but please do try searching before posting a new question. – Don't Panic Mar 31 '20 at 00:41

0 Answers0