How to get full link in php code?

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



Create a file index.php



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’].” ?>




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 *