Any way to get URL fragment with Yii2?

I’m using the pathInfo method to get the path info, however I also need the fragment (hash value).

I notice it’s included when you use the php parse_url function, so wondering if there is anything included with Yii as well or should I just do a second call to PHP’s internal function instead?

Hash value isn’t transferred to the server so you can’t get it.

Curious how the parse_url function works then - I tested it and it seems to work fine.

parse_url doesn’t work with http request. It just convert url as string to url as array.