Home » Php » php – Including Fragment Indentifier with CURLINFO_EFFECTIVE_URL?

php – Including Fragment Indentifier with CURLINFO_EFFECTIVE_URL?

Posted by: admin February 25, 2020 Leave a comment

Questions:

I’m trying to use CURLINFO_EFFECTIVE_URL to get the final redirect URL.

It works it most cases, but it appears to strip #whatever from the URL.

So, if this is the final URL:

http://example.com/?test=123#something

It’s showing me this:

http://example.com/?test=123

Is there any way to force it to include the fragment identifier?

If not, is there any simple alternative to using CURLINFO_EFFECTIVE_URL instead?

My primary goal is to get the final redirect URL and if #uid- is in it, I want to echo something – and if it doesn’t exist in the URL (or if there are not any redirects), I want to echo something else…

How to&Answers: