2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Specialized String Functions for phpMyAdmin
6 * Copyright 2002 Robin Johnson <robbat2@users.sourceforge.net>
7 * http://www.orbis-terrarum.net/?l=people.robbat2
9 * Defines a set of function callbacks that have a pure C version available if
10 * the "ctype" extension is available, but otherwise have PHP versions to use
13 * The SQL Parser code relies heavily on these functions.
16 * @package phpMyAdmin-StringType-CType
20 * Checks if a character is an alphanumeric one
23 * @param string 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
35 * @param string 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
47 * @param string 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
59 * @param string 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
72 * @param string 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
84 * @param string 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 * @uses ctype_xdigit()
96 * @param string 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