PHP  
downloads | documentation | faq | getting help | mailing lists | | php.net sites | links | my php.net 
search for in the  
<cyrus_unbindctype_alnum>
view the version of this page
Last updated: Tue, 22 Apr 2003

XVI. Character type functions

Introductie

The functions provided by this extension check whether a character or string falls into a certain character class according to the current locale (see also setlocale()).

When called with an integer argument these functions behave exactly like their C counterparts from ctype.h.

When called with a string argument they will check every character in the string and will only return TRUE if every character in the string matches the requested criteria. When called with an empty string the result will always be TRUE.

Passing anything else but a string or integer will return FALSE immediately.

Afhankelijkheden

None besides functions from the standard C library which are always available.

Installatie

Beginning with PHP 4.2.0 these functions are enabled by default. For older versions you have to configure and compile PHP with --enable-ctype. You can disable ctype support with --disable-ctype.

Deze functies worden automatisch ingebouwd in de windows versie van PHP. Er zijn geen extra handelingen nodig om deze functies te gebruiken.

Opmerking: Builtin support for ctype is available with PHP 4.3.0.

Configuratie tijdens scriptuitvoer

Deze extensie gebruikt geen configuratie regels.

Resource types

Deze extensie maakt geen gebruik van resources.

Voorgedefineerde constanten

Deze extensie definieert geen constanten.

Inhoudsopgave
ctype_alnum -- Check for alphanumeric character(s)
ctype_alpha -- Check for alphabetic character(s)
ctype_cntrl -- Check for control character(s)
ctype_digit -- Check for numeric character(s)
ctype_graph -- Check for any printable character(s) except space
ctype_lower -- Check for lowercase character(s)
ctype_print -- Check for printable character(s)
ctype_punct --  Check for any printable character which is not whitespace or an alphanumeric character
ctype_space -- Check for whitespace character(s)
ctype_upper -- Check for uppercase character(s)
ctype_xdigit --  Check for character(s) representing a hexadecimal digit


User Contributed Notes
Character type functions
add a note add a note
maxim at php dot net
07-Aug-2002 08:32

Editors note:

CTYPE functions are always prefered, when possible, to Regular Expressions and, often, even to some equivalent str_*, is_* functions. This is because of the fact that CTYPE uses a native C library and thus processes signitificaly faster.

Maxim Maletsky

roadlesstravelled at canada dot com
12-Aug-2002 03:05

The ctype function(s) won't work under Windows(tm) unless you define the extention path and load the php_ctype.dll in php.ini
ex. edit php.ini:
extension_dir = c:\php\extensions
and
uncomment the extension=php_ctype.dll (take off the ';' from behind the declaration)

-sigmat

add a note add a note

<cyrus_unbindctype_alnum>
 Last updated: Tue, 22 Apr 2003
show source | credits | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by: /
Last updated: Sun May 25 21:10:51 2003 CEST