Migrate from CC ++ to PHP-a function that determines the character type. In CC ++, the header file ctype. h defines a set of macros for character types to obtain the type of the given characters. PHP does not have related functions. A few days ago, I found that in PHP downloaded from www.mm4.de, in C/C ++, the header file ctype. h defines a set of macros for the character type to get the type of the given character.
PHP does not have related functions. The other day I found that an extension Library named php_ctype.dll was provided in PHP downloaded from www.mm4.de,
Some of these functions are provided after loading, which are specially sorted out for your reference.
After correctly loading the php_ctype.dll file in PHP, use You can see the following information:
Ctype
Ctype functions enabled (experimental)
Then you can use the functions it provides. The usage of all functions is basically the same as that of C/C ++. The difference is that the function parameters in C/C ++ are
Character type (char), while the function parameter in PHP can be a string ). For example:
$ String = "123 ADAADAD ";
If (isalnum ($ string ))
{
Echo "only contains uppercase and lowercase letters and numbers! ";
}
?>
Appendix: functions supported by php_ctype.dll
Bool isalnum (string)
Bool isalpha (string)
Bool iscntrl (string)
Bool isdigit (string)
Bool isgraph (string)
Bool islower (string)
Bool isprint (string)
Bool ispunct (string)
Bool isspace (string)
Bool isupper (string)
Bool isxdigit (string)
[This article is copyrighted by the author Fan Cao 0515 and osuo. if you need to reprint it, please indicate the author and its source]
Bytes. PHP does not have related functions. A few days ago, I found PHP downloaded at www.mm4.de...