|
|
@@ -0,0 +1,33 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!-- Reviewed: no -->
|
|
|
+<sect2 id="zend.validate.set.hex">
|
|
|
+ <title>Hex</title>
|
|
|
+
|
|
|
+ <para>
|
|
|
+ <classname>Zend_Validate_Hex</classname> allows you to validate if a given value contains
|
|
|
+ only hexadecimal characters. These are all characters from <emphasis>0 to 9</emphasis> and
|
|
|
+ <emphasis>A to F</emphasis> case insensitive. There is no length limitation for the input
|
|
|
+ you want to validate.
|
|
|
+ </para>
|
|
|
+
|
|
|
+ <programlisting language="php"><![CDATA[
|
|
|
+$validator = new Zend_Validate_Hex();
|
|
|
+if ($validator->isValid('123ABC')) {
|
|
|
+ // value contains only hex chars
|
|
|
+} else {
|
|
|
+ // false
|
|
|
+}
|
|
|
+]]></programlisting>
|
|
|
+
|
|
|
+ <note>
|
|
|
+ <title>Invalid characters</title>
|
|
|
+
|
|
|
+ <para>
|
|
|
+ All other characters will return false, including whitespace and decimal point. Also
|
|
|
+ unicode zeros and numbers from other scripts than latin will not be treaten as valid.
|
|
|
+ </para>
|
|
|
+ </note>
|
|
|
+</sect2>
|
|
|
+<!--
|
|
|
+vim:se ts=4 sw=4 et:
|
|
|
+-->
|