2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Implements PMA_StringType interface using the "ctype" extension.
5 * Methods of the "ctype" extension are faster compared to PHP versions of them.
7 * @package PhpMyAdmin-String
10 if (! defined('PHPMYADMIN')) {
14 require_once 'libraries/StringAbstractType.class.php';
17 * Implements PMA_StringType interface using the "ctype" extension.
18 * Methods of the "ctype" extension are faster compared to PHP versions of them.
20 * @package PhpMyAdmin-String
23 class PMA_StringCType
extends PMA_StringAbstractType
26 * Checks if a character is an alphanumeric one
28 * @param string $c character to check for
30 * @return boolean whether the character is an alphanumeric one or not
32 public function isAlnum($c)
34 return ctype_alnum($c);
35 } // end of the "isAlnum()" function
38 * Checks if a character is an alphabetic one
40 * @param string $c character to check for
42 * @return boolean whether the character is an alphabetic one or not
44 public function isAlpha($c)
46 return ctype_alpha($c);
47 } // end of the "isAlpha()" function
50 * Checks if a character is a digit
52 * @param string $c character to check for
54 * @return boolean whether the character is a digit or not
56 public function isDigit($c)
58 return ctype_digit($c);
59 } // end of the "isDigit()" function
62 * Checks if a character is an upper alphabetic one
64 * @param string $c character to check for
66 * @return boolean whether the character is an upper alphabetic one or not
68 public function isUpper($c)
70 return ctype_upper($c);
71 } // end of the "isUpper()" function
75 * Checks if a character is a lower alphabetic one
77 * @param string $c character to check for
79 * @return boolean whether the character is a lower alphabetic one or not
81 public function isLower($c)
83 return ctype_lower($c);
84 } // end of the "PisLower()" function
87 * Checks if a character is a space one
89 * @param string $c character to check for
91 * @return boolean whether the character is a space one or not
93 public function isSpace($c)
95 return ctype_space($c);
96 } // end of the "isSpace()" function
99 * Checks if a character is an hexadecimal digit
101 * @param string $c character to check for
103 * @return boolean whether the character is an hexadecimal digit or not
105 public function isHexDigit($c)
107 return ctype_xdigit($c);
108 } // end of the "isHexDigit()" function