preg_match for Hexadecimal Strings

function isHexadecimalString ( $str ) {
if ( preg_match("/^[a-f0-9]{1,}$/is", $str) ) {
return true;
} else {
return false;
}
}

source

Comments are closed.