Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin...
[phpmyadmin/crack.git] / libraries / string_type_ctype.lib.php
blobb211dd59c3684a44ad37f8d0c9f3cddc59826bf6
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
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
11 * (that are slower).
13 * The SQL Parser code relies heavily on these functions.
15 * @package phpMyAdmin-StringType-CType
18 /**
19 * Checks if a character is an alphanumeric one
21 * @uses ctype_alnum()
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
30 /**
31 * Checks if a character is an alphabetic one
33 * @uses ctype_alpha()
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
42 /**
43 * Checks if a character is a digit
45 * @uses ctype_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
54 /**
55 * Checks if a character is an upper alphabetic one
57 * @uses ctype_upper()
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
67 /**
68 * Checks if a character is a lower alphabetic one
70 * @uses ctype_lower()
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
79 /**
80 * Checks if a character is a space one
82 * @uses ctype_space()
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
91 /**
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