0

PHP script to get the user or client IP address

ip

To get the client IP address

<?php
$strCurrentTime = date(“y-m-d h:i:s”,time());
$strIP = $_SERVER[‘REMOTE_ADDR’];
echo $strIP;
?>

output

127.0.0.1

Note: IP address is dynamic so output may differ.

Filed in: General, PHP

Recent Posts

Bookmark and Promote!

Leave a Reply

Submit Comment
© 2017 Expert Shout. All rights reserved. XHTML / CSS Valid.