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.
19 * Checks if a character is an alphanumeric one
22 * @param string character to check for
23 * @return boolean whether the character is an alphanumeric one or not
25 function PMA_STR_isAlnum($c)
27 return ctype_alnum($c);
28 } // end of the "PMA_STR_isAlnum()" function
31 * Checks if a character is an alphabetic one
34 * @param string character to check for
35 * @return boolean whether the character is an alphabetic one or not
37 function PMA_STR_isAlpha($c)
39 return ctype_alpha($c);
40 } // end of the "PMA_STR_isAlpha()" function
43 * Checks if a character is a digit
46 * @param string character to check for
47 * @return boolean whether the character is a digit or not
49 function PMA_STR_isDigit($c)
51 return ctype_digit($c);
52 } // end of the "PMA_STR_isDigit()" function
55 * Checks if a character is an upper alphabetic one
58 * @param string character to check for
59 * @return boolean whether the character is an upper alphabetic one or not
61 function PMA_STR_isUpper($c)
63 return ctype_upper($c);
64 } // end of the "PMA_STR_isUpper()" function
68 * Checks if a character is a lower alphabetic one
71 * @param string character to check for
72 * @return boolean whether the character is a lower alphabetic one or not
74 function PMA_STR_isLower($c)
76 return ctype_lower($c);
77 } // end of the "PMA_STR_isLower()" function
80 * Checks if a character is a space one
83 * @param string character to check for
84 * @return boolean whether the character is a space one or not
86 function PMA_STR_isSpace($c)
88 return ctype_space($c);
89 } // end of the "PMA_STR_isSpace()" function
92 * Checks if a character is an hexadecimal digit
94 * @uses ctype_xdigit()
95 * @param string character to check for
96 * @return boolean whether the character is an hexadecimal digit or not
98 function PMA_STR_isHexDigit($c)
100 return ctype_xdigit($c);
101 } // end of the "PMA_STR_isHexDigit()" function