2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Specialized String Functions for phpMyAdmin
6 * Defines a set of function callbacks that have a pure C version available if
7 * the "ctype" extension is available, but otherwise have PHP versions to use
10 * The SQL Parser code relies heavily on these functions.
12 * @package PhpMyAdmin-String
15 if (! defined('PHPMYADMIN')) {
20 * Checks if a character is an alphanumeric one
22 * @param string $c character to check for
24 * @return boolean whether the character is an alphanumeric one or not
26 function PMA_STR_isAlnum($c)
28 return ctype_alnum($c);
29 } // end of the "PMA_STR_isAlnum()" function
32 * Checks if a character is an alphabetic one
34 * @param string $c character to check for
36 * @return boolean whether the character is an alphabetic one or not
38 function PMA_STR_isAlpha($c)
40 return ctype_alpha($c);
41 } // end of the "PMA_STR_isAlpha()" function
44 * Checks if a character is a digit
46 * @param string $c character to check for
48 * @return boolean whether the character is a digit or not
50 function PMA_STR_isDigit($c)
52 return ctype_digit($c);
53 } // end of the "PMA_STR_isDigit()" function
56 * Checks if a character is an upper alphabetic one
58 * @param string $c character to check for
60 * @return boolean whether the character is an upper alphabetic one or not
62 function PMA_STR_isUpper($c)
64 return ctype_upper($c);
65 } // end of the "PMA_STR_isUpper()" function
69 * Checks if a character is a lower alphabetic one
71 * @param string $c character to check for
73 * @return boolean whether the character is a lower alphabetic one or not
75 function PMA_STR_isLower($c)
77 return ctype_lower($c);
78 } // end of the "PMA_STR_isLower()" function
81 * Checks if a character is a space one
83 * @param string $c character to check for
85 * @return boolean whether the character is a space one or not
87 function PMA_STR_isSpace($c)
89 return ctype_space($c);
90 } // end of the "PMA_STR_isSpace()" function
93 * Checks if a character is an hexadecimal digit
95 * @param string $c character to check for
97 * @return boolean whether the character is an hexadecimal digit or not
99 function PMA_STR_isHexDigit($c)
101 return ctype_xdigit($c);
102 } // end of the "PMA_STR_isHexDigit()" function