Revision: 11617
Updated Code
at February 11, 2009 11:37 by duniyadnd
Updated Code
function isHexadecimalString ( $str ) { if ( preg_match("/^[a-f0-9]{1,}$/is", $str) ) { return true; } else { return false; } }
Revision: 11616
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at February 11, 2009 11:00 by duniyadnd
Initial Code
<? function isHexadecimalString ( $str ) { if ( preg_match("/^[a-f0-9]{1,}$/is", $str) ) { return true; } else { return false; } } ?>
Initial URL
Initial Description
Figure out if the string possesses only hexadecimal characters in the string. If not, fail. Remember, white spaces are not hexadecimal, so make sure you trim() your strings before you send it in or explode your string.
Initial Title
preg_match for Hexadecimal Strings
Initial Tags
php
Initial Language
PHP