Get IP address via PHP

To get user IP address you need only this variable:

<?php
echo $_SERVER['REMOTE_ADDR'];
?>

In this example you echo user ip address. You can also use a variable like $ip = $_SERVER[‘REMOTE_ADDR’];

Leave a Reply

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