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

A Filipino programmer with a variety of interests such as baking, singing, making up silly song/rap lyrics, K-pop, drawing, creating unique dessert flavors, obsessing about finding out how some things works, board games, anime, video games, and forgetting things that usually go in her long list of interests. Running small-time online dessert shops Cookies PH and Catzie's Cakery.

Leave a Reply

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