What is My IP – Source Code

Here is the PHP source code to display the IP address of the HTTP request:



<?php
  echo ‘Your IP address is: <span style=”color: red;”>’.$_SERVER['REMOTE_ADDR'].‘</span>’;
?>

The key is $_SERVER[‘REMOTE_ADDR'] which returns the IP address.

Leave a Reply

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

*