src/Utility/Utility.php
public static function getClientIp($safe = true) {
		if (!$safe && env('HTTP_X_FORWARDED_FOR')) {
			$ipaddr = preg_replace('/(?:,.*)/', '', env('HTTP_X_FORWARDED_FOR'));
		} elseif (!$safe && env('HTTP_CLIENT_IP')) {
			$ipaddr = env('HTTP_CLIENT_IP');
		} else {
			$ipaddr = env('REMOTE_ADDR');
		}
		return trim($ipaddr);
	}
public static function getClientIp($safe = true) {
		if (!$safe && env('HTTP_X_FORWARDED_FOR')) {
			$ipaddr = preg_replace('/(?:,.*)/', '', env('HTTP_X_FORWARDED_FOR'));
		} elseif (!$safe && env('HTTP_CLIENT_IP')) {
			$ipaddr = env('HTTP_CLIENT_IP');
		} else {
			$ipaddr = env('REMOTE_ADDR');
		}
		return trim($ipaddr);
	}
public static function getClientIp ( $ safe = true ) { if ( ! $ safe && env ( 'HTTP_X_FORWARDED_FOR' ) ) { $ ipaddr = preg_replace ( '/(?:,.*)/' , '' , env ( 'HTTP_X_FORWARDED_FOR' ) ) ; } elseif ( ! $ safe && env ( 'HTTP_CLIENT_IP' ) ) { $ ipaddr = env ( 'HTTP_CLIENT_IP' ) ; } else { $ ipaddr = env ( 'REMOTE_ADDR' ) ; } return trim ( $ ipaddr ) ; }
Get the current IP address.

@param bool $safe
@return string IP address
Get the current IP address .