PHP script to get the user or client IP address October 15, 2023September 29, 2015 by Spark 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.