How to get full link in php code?


Here is short php code to get full link of a website including path.

 

Step-1

Create a file index.php

 

Step-2

Now, Add following codes in index.php

 

Domain code:

<?php echo”.$_SERVER[‘HTTP_HOST’].” ?>

 

Domain path code:

<?php echo”.$_SERVER[‘REQUEST_URI’].” ?>

 

Full url code:

<?php echo”.$_SERVER[‘HTTP_HOST’].$_SERVER[‘REQUEST_URI’].” ?>

 

Done.

 



Find More related How to get full link in php code?


Have any Question or Comment?

Leave a Reply

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