PHP_SELF Function to Get Current Page URL

You may use the PHP_SELF function to the your current page url, but pay attention to what it returns below.

Here are some examples:

Here is how to print the current page URL to your screen:
echo PHP_SELF;

If your script that includes PHP_SELF is at, it would return:

Leave a Reply

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