"Invalid type given, value should be a string", self::NOT_HEX => "'%value%' has not only hexadecimal digit characters", ); /** * Defined by Zend_Validate_Interface * * Returns true if and only if $value contains only hexadecimal digit characters * * @param string $value * @return boolean */ public function isValid($value) { if (!is_string($value) && !is_int($value)) { $this->_error(self::INVALID); return false; } $this->_setValue($value); if (!ctype_xdigit((string) $value)) { $this->_error(self::NOT_HEX); return false; } return true; } }