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!

Add a Comment

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