How to get the full url of the Current page in PHP?

Here is the solution all of you searching for, Its very simple to get the full URL of the Current page using php $_SERVER

Copy and paste the below code and run the script so you can see the result immediately:


<?php

$CurrenURL = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];

echo $CurrenURL;

?>

Enjoy!

Leave a Reply

Theme: Overlay by Kaira
Agurchand