public static function checkCardHolderData($value, $type = '') {       
        
        $value = filter_var(trim($value),FILTER_SANITIZE_SPECIAL_CHARS);
        
        //validate length of input data and throw exception
        //if maximum characters is not mentioned in $_inputFldMaxLength the sanitized values will be returned
        if (!empty(self::$_inputFldMaxLength[$type]) && strlen($value) > self::$_inputFldMaxLength[$type]) {            
            $errorMessage = "The value for $type can be no more than " . self::$_inputFldMaxLength[$type] . ' characters, Please try again after making corrections';
            throw new HpsInvalidRequestException(
                HpsExceptionCodes::INVALID_INPUT_LENGTH, $errorMessage
            );
        }
        return $value;
    }
public static function checkCardHolderData($value, $type = '') {       
        
        $value = filter_var(trim($value),FILTER_SANITIZE_SPECIAL_CHARS);
        
        //validate length of input data and throw exception
        //if maximum characters is not mentioned in $_inputFldMaxLength the sanitized values will be returned
        if (!empty(self::$_inputFldMaxLength[$type]) && strlen($value) > self::$_inputFldMaxLength[$type]) {            
            $errorMessage = "The value for $type can be no more than " . self::$_inputFldMaxLength[$type] . ' characters, Please try again after making corrections';
            throw new HpsInvalidRequestException(
                HpsExceptionCodes::INVALID_INPUT_LENGTH, $errorMessage
            );
        }
        return $value;
    }
public static function checkCardHolderData ( $ value , $ type = '' ) { $ value = filter_var ( trim ( $ value ) , FILTER_SANITIZE_SPECIAL_CHARS ) ; //validate length of input data and throw exception //if maximum characters is not mentioned in $_inputFldMaxLength the sanitized values will be returned if ( ! empty ( self :: $ _inputFldMaxLength [ $ type ] ) && strlen ( $ value ) > self :: $ _inputFldMaxLength [ $ type ] ) { $ errorMessage = "The value for $type can be no more than " . self :: $ _inputFldMaxLength [ $ type ] . ' characters, Please try again after making corrections' ; throw new HpsInvalidRequestException ( HpsExceptionCodes :: INVALID_INPUT_LENGTH , $ errorMessage ) ; } return $ value ; }
This method clears the user input and return the user input in correct format or throw an exception

@param string $value this is user entered value (first name or last name or email or city)
@param string $type this is user entered value field name
@return string
@throws HpsInvalidRequestException
This method clears the user input and return the user input in correct format or throw an exception