public static function is_ajax($is_phery = false)
    {
        switch ($is_phery) {
            case true:
                return (bool)(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&
                    strcasecmp($_SERVER['HTTP_X_REQUESTED_WITH'], 'XMLHttpRequest') === 0 &&
                    strtoupper($_SERVER['REQUEST_METHOD']) === 'POST' &&
                    !empty($_SERVER['HTTP_X_PHERY']));
            case false:
                return (bool)(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&
                    strcasecmp($_SERVER['HTTP_X_REQUESTED_WITH'], 'XMLHttpRequest') === 0);
        }
        return false;
    }
public static function is_ajax($is_phery = false)
    {
        switch ($is_phery) {
            case true:
                return (bool)(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&
                    strcasecmp($_SERVER['HTTP_X_REQUESTED_WITH'], 'XMLHttpRequest') === 0 &&
                    strtoupper($_SERVER['REQUEST_METHOD']) === 'POST' &&
                    !empty($_SERVER['HTTP_X_PHERY']));
            case false:
                return (bool)(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&
                    strcasecmp($_SERVER['HTTP_X_REQUESTED_WITH'], 'XMLHttpRequest') === 0);
        }
        return false;
    }
public static function is_ajax ( $ is_phery = false ) { switch ( $ is_phery ) { case true : return ( bool ) ( ! empty ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) && strcasecmp ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] , 'XMLHttpRequest' ) === 0 && strtoupper ( $ _SERVER [ 'REQUEST_METHOD' ] ) === 'POST' && ! empty ( $ _SERVER [ 'HTTP_X_PHERY' ] ) ) ; case false : return ( bool ) ( ! empty ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) && strcasecmp ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] , 'XMLHttpRequest' ) === 0 ) ; } return false ; }
Check if the current call is an ajax call

@param bool $is_phery Check if is an ajax call and a phery specific call

@static
@return bool
Check if the current call is an ajax call