classes/Request.php
public static function IP(){
   switch(true){
     case !empty($_SERVER['HTTP_X_FORWARDED_FOR']):
       $ip = trim(substr(strrchr($_SERVER['HTTP_X_FORWARDED_FOR'],','),1) ?: $_SERVER['HTTP_X_FORWARDED_FOR']);
     break;
     case !empty($_SERVER['HTTP_X_FORWARDED_HOST']):
       $ip = trim(substr(strrchr($_SERVER['HTTP_X_FORWARDED_HOST'],','),1) ?: $_SERVER['HTTP_X_FORWARDED_HOST']);
     break;
     case !empty($_SERVER['REMOTE_ADDR']):    $ip = $_SERVER['REMOTE_ADDR']; break;
     case !empty($_SERVER['HTTP_CLIENT_IP']): $ip = $_SERVER['HTTP_CLIENT_IP']; break;
     default:                                 $ip = ''; break;
   }
   return Filter::with('core.request.IP',$ip);
  }
public static function IP(){
   switch(true){
     case !empty($_SERVER['HTTP_X_FORWARDED_FOR']):
       $ip = trim(substr(strrchr($_SERVER['HTTP_X_FORWARDED_FOR'],','),1) ?: $_SERVER['HTTP_X_FORWARDED_FOR']);
     break;
     case !empty($_SERVER['HTTP_X_FORWARDED_HOST']):
       $ip = trim(substr(strrchr($_SERVER['HTTP_X_FORWARDED_HOST'],','),1) ?: $_SERVER['HTTP_X_FORWARDED_HOST']);
     break;
     case !empty($_SERVER['REMOTE_ADDR']):    $ip = $_SERVER['REMOTE_ADDR']; break;
     case !empty($_SERVER['HTTP_CLIENT_IP']): $ip = $_SERVER['HTTP_CLIENT_IP']; break;
     default:                                 $ip = ''; break;
   }
   return Filter::with('core.request.IP',$ip);
  }
public static function IP ( ) { switch ( true ) { case ! empty ( $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ) : $ ip = trim ( substr ( strrchr ( $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] , ',' ) , 1 ) ? : $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ) ; break ; case ! empty ( $ _SERVER [ 'HTTP_X_FORWARDED_HOST' ] ) : $ ip = trim ( substr ( strrchr ( $ _SERVER [ 'HTTP_X_FORWARDED_HOST' ] , ',' ) , 1 ) ? : $ _SERVER [ 'HTTP_X_FORWARDED_HOST' ] ) ; break ; case ! empty ( $ _SERVER [ 'REMOTE_ADDR' ] ) : $ ip = $ _SERVER [ 'REMOTE_ADDR' ] ; break ; case ! empty ( $ _SERVER [ 'HTTP_CLIENT_IP' ] ) : $ ip = $ _SERVER [ 'HTTP_CLIENT_IP' ] ; break ; default : $ ip = '' ; break ; } return Filter :: with ( 'core.request.IP' , $ ip ) ; }
Returns the remote IP

@return string
Returns the remote IP