public static function isLocalHost($host)
    {
        if (empty($host)) {
            return false;
        }

        // remove port
        $hostWithoutPort = explode(':', $host);
        array_pop($hostWithoutPort);
        $hostWithoutPort = implode(':', $hostWithoutPort);

        $localHostnames = Url::getLocalHostnames();
        return in_array($host, $localHostnames, true)
            || in_array($hostWithoutPort, $localHostnames, true);
    }
public static function isLocalHost($host)
    {
        if (empty($host)) {
            return false;
        }

        // remove port
        $hostWithoutPort = explode(':', $host);
        array_pop($hostWithoutPort);
        $hostWithoutPort = implode(':', $hostWithoutPort);

        $localHostnames = Url::getLocalHostnames();
        return in_array($host, $localHostnames, true)
            || in_array($hostWithoutPort, $localHostnames, true);
    }
public static function isLocalHost ( $ host ) { if ( empty ( $ host ) ) { return false ; } // remove port $ hostWithoutPort = explode ( ':' , $ host ) ; array_pop ( $ hostWithoutPort ) ; $ hostWithoutPort = implode ( ':' , $ hostWithoutPort ) ; $ localHostnames = Url :: getLocalHostnames ( ) ; return in_array ( $ host , $ localHostnames , true ) || in_array ( $ hostWithoutPort , $ localHostnames , true ) ; }
Checks whether the given host is a local host like `127.0.0.1` or `localhost`.

@param string $host
@return bool
Checks whether the given host is a local host like 127 . 0 . 0 . 1 or localhost .