What is the php Function Ctype_XDigit?
You will have seen ctype_xdigit() function in your PHP scripts, but you might not know what it does. It is one of the many string functions that come with php and you can use it to check if a string has certain characters.
php ctype_xdigit function checks if every character in the input string is hexadecimal digit (or something else) and return TRUE or FALSE. if any hexadecimal digit or char from [A-F] is present then it will return true else it will return false.
The ctype_xdigit method takes a single parameter called text which is the string to be checked. The string will be internally converted to an int (or something else), and then it will be checked if all the values of that int are valid hexadecimal digits or not.
Note: ctype_xdigit is an EXPERIMENTAL function. The behaviour of this function, its name, and anything else documented about it may change in a future version of PHP without notice.
The ctype_xdigit function comes bundled with the other string and char type functions as part of the Ctype extension which is enabled by default in your PHP installation. However, some hosting providers might disable it for some crazy reason. In that case, you would need to ask them to enable it for your website.