2 /* Prototype : bool ctype_xdigit(mixed $c)
3 * Description: Checks for character(s) representing a hexadecimal digit
4 * Source code: ext/ctype/ctype.c
8 * Pass strings containing different character types to ctype_xdigit() to test
9 * which are considered valid hexadecimal 'digit' only strings
12 echo "*** Testing ctype_xdigit() : usage variations ***\n";
14 $orig = setlocale(LC_CTYPE
, "C");
17 /*1*/ "This string contains just letters and spaces", // Simple string
18 "but this one contains some numbers too 123+456 = 678", // Mixed string
28 "03F", // hexadecimal 'digits'
39 base64_decode("w4DDoMOHw6fDiMOo"), // non-ascii characters
46 foreach($values as $value) {
47 echo "\n-- Iteration $iterator --\n";
48 var_dump( ctype_xdigit($value) );
52 setlocale(LC_CTYPE
, $orig);