<?PHP require ("class.hex2bin.php"); $hex2bin = new hex2bin(); function hex($hex) { $bin = $GLOBALS["hex2bin"]->convert($hex); if ($bin === FALSE) { printf("%s isn't a hex string\n",$hex); } else { printf("the hex string %s is the bin string %s\n",$hex,$bin); } } // true hex("aabb33"); // false hex("aac"); // false hex("AJJJ22"); ?>