how to get ip address of user code example Example 1: php get user ip $ip = $_SERVER['REMOTE_ADDR']; Example 2: php get client ip $_SERVER['REMOTE_ADDR']