_php tutorial for migrating to php--judging character types from C/s + +

Source: Internet
Author: User
A set of macros for a character type is defined in the header file, ctype.h, to give the type of the given character.
And there are no related functions in PHP. A few days ago, we found an extension library called Php_ctype.dll in PHP www.mm4.de downloaded.
After loading found to provide some of these functions, special collation out for your reference.
After loading the Php_ctype.dll file correctly in PHP, use the You can see the following information:
CType
CType functions enabled (experimental)
You can then use the functions it provides. The use of all functions is basically the same as C + +, except that the parameters of the function in C + + are
Character type (char), whereas in PHP the arguments to a function can be strings (string). For example:

$string = "123ADAADAD";
if (Isalnum ($string))
{
echo "only uppercase and lowercase letters and numbers! ";
}

?>

Attached: 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)

"The copyright of this article is the author of all Grass 0515 and house Orso near Network co-owned, if necessary to reprint, please specify the author and source"

http://www.bkjia.com/PHPjc/316621.html www.bkjia.com true http://www.bkjia.com/PHPjc/316621.html techarticle A set of macros for a character type is defined in the header file, ctype.h, to give the type of the given character. And there are no related functions in PHP. Some days ago found in php www.mm4.de download ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.