PHP: get full URL of current page with GET params or without

The following string variable’s value will get the full URL of the current page, including GET arguments/params, if present.

To get the full URL of current page but WITHOUT the GET args/params, do this instead:

The strtok function will return only the part of the URL string up to the character before question mark “?” which is used by GET args/params.

strtok was suggested in this StackOverflow answer: http://stackoverflow.com/a/4643312

Related Posts:

Posts that may be related to "PHP: get full URL of current page with GET params or without":

Catzie

An odd human being who happens to have a variety of ever-changing interests, but right now they are programming, making up silly song/rap lyrics, K-pop, drawing, creating unique dessert/drink flavors, obsessing about finding out how some things works, automation, anime, video games... Ran online dessert shops Cookies PH and Catzie's Cakery in her past life.

Leave a Reply

Your email address will not be published. Required fields are marked *