mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-29 07:18:55 +00:00

some more detailed descriptions for the functions (although the one-liners should have been pretty clear) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@71678 c90b9560-bf6c-de11-be94-00142212c4b1
342 lines
11 KiB
XML
342 lines
11 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.19 $ -->
|
|
<reference id="ref.ctype">
|
|
<title>Character type functions</title>
|
|
<titleabbrev>ctype</titleabbrev>
|
|
|
|
<partintro>
|
|
|
|
<para id="ctype.intro">
|
|
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 <function>setlocale</function>).
|
|
</para>
|
|
<para>
|
|
When called with an integer argument these functions
|
|
behave exactly like their C counterparts from "ctype.h".
|
|
</para>
|
|
<para>
|
|
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.
|
|
</para>
|
|
<para>
|
|
Passing anything else but a string or integer will
|
|
return &false; immediately.
|
|
</para>
|
|
|
|
<section id="ctype.requirenments">
|
|
<title>Requirements</title>
|
|
<para>
|
|
None besides functions from the standard C library which are
|
|
always available.
|
|
</para>
|
|
</section>
|
|
|
|
<section id="ctype.installation">
|
|
<title>Installation</title>
|
|
<para>
|
|
Beginning with PHP 4.2.0 this function are enabled by default.
|
|
For older versions you have to configure and compile PHP
|
|
with <option role="configure">--enable-ctype</option>.
|
|
</para>
|
|
</section>
|
|
|
|
<section id="ctype.configuration">
|
|
<title>Runtime Configuration</title>
|
|
<para>
|
|
This extension does not define any configuration directives.
|
|
</para>
|
|
</section>
|
|
|
|
<section id="ctype.resources">
|
|
<title>Resource types</title>
|
|
<para>
|
|
This extension does not define any resource types.
|
|
</para>
|
|
</section>
|
|
|
|
<section id="ctype.constants">
|
|
<title>Predefined constants</title>
|
|
<para>
|
|
This extension does not define any constants.
|
|
</para>
|
|
</section>
|
|
|
|
</partintro>
|
|
|
|
|
|
<refentry id="function.ctype-alnum">
|
|
<refnamediv>
|
|
<refname>ctype_alnum</refname>
|
|
<refpurpose>Check for alphanumeric character(s)</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ctype_alnum</methodname>
|
|
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if every character in <parameter>text</parameter> is either
|
|
a letter or a digit, &false; otherwise. In the standard <literal>C</literal>
|
|
locale letters are just <literal>[A-Za-z]</literal>. The function is equivalent
|
|
to <literal>(ctype_alpha($text) || ctype_digit($text))</literal>.
|
|
</para>
|
|
<para>
|
|
See also <function>ctype_alpha</function>, <function>ctype_digit</function>,
|
|
and <function>setlocale</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ctype-alpha">
|
|
<refnamediv>
|
|
<refname>ctype_alpha</refname>
|
|
<refpurpose>Check for alphabetic character(s)</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ctype_alpha</methodname>
|
|
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if every character in <parameter>text</parameter> is
|
|
a letter from the current locale, &false; otherwise.
|
|
In the standard <literal>C</literal> locale letters are just
|
|
<literal>[A-Za-z]</literal> and <function>ctype_alpha</function> is
|
|
equivalent to <literal>(ctype_upper($text) || ctype_lower($text))</literal>,
|
|
but other languages have letters that are considered neither upper nor
|
|
lower case.
|
|
</para>
|
|
<para>
|
|
See also <function>ctype_upper</function>,
|
|
<function>ctype_lower</function>, and
|
|
<function>setlocale</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ctype-cntrl">
|
|
<refnamediv>
|
|
<refname>ctype_cntrl</refname>
|
|
<refpurpose>Check for control character(s)</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ctype_cntrl</methodname>
|
|
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if every character in <parameter>text</parameter> has
|
|
a special control funcion, &false; otherwise. Control characters are
|
|
e.g. line feed, tab, esc.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ctype-digit">
|
|
<refnamediv>
|
|
<refname>ctype_digit</refname>
|
|
<refpurpose>Check for numeric character(s)</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ctype_digit</methodname>
|
|
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if every character in <parameter>text</parameter> is
|
|
a decimal digit, &false; otherwise.
|
|
</para>
|
|
<para>
|
|
See also <function>ctype_alnum</function> and <function>ctype_xdigit</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ctype-lower">
|
|
<refnamediv>
|
|
<refname>ctype_lower</refname>
|
|
<refpurpose>Check for lowercase character(s)</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ctype_lower</methodname>
|
|
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if every character in <parameter>text</parameter> is
|
|
a lowercase letter in the current locale.
|
|
</para>
|
|
<para>
|
|
See also <function>ctype_alpha</function> and <function>ctype_upper</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ctype-graph">
|
|
<refnamediv>
|
|
<refname>ctype_graph</refname>
|
|
<refpurpose>Check for any printable character(s) except space</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ctype_graph</methodname>
|
|
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if every character in <parameter>text</parameter> is
|
|
printable and actualy creates visible output (no white space), &false;
|
|
otherwise.
|
|
</para>
|
|
<para>
|
|
See also <function>ctype_alnum</function>, <function>ctype_print</function>,
|
|
and <function>ctype_punct</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ctype-print">
|
|
<refnamediv>
|
|
<refname>ctype_print</refname>
|
|
<refpurpose>Check for printable character(s)</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ctype_print</methodname>
|
|
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if every character in <parameter>text</parameter>
|
|
will actualy create output (including blanks). Returns &false; if
|
|
<parameter>text</parameter> contains control characters or characters
|
|
that do not have any output or control function at all.
|
|
</para>
|
|
<para>
|
|
See also <function>ctype_cntrl</function>, <function>ctype_graph</function>,
|
|
and <function>ctype_punct</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ctype-punct">
|
|
<refnamediv>
|
|
<refname>ctype_punct</refname>
|
|
<refpurpose>
|
|
Check for any printable character which is not whitespace or an
|
|
alphanumeric character
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ctype_punct</methodname>
|
|
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if every character in <parameter>text</parameter>
|
|
is printable, but neither letter, digit or blank, &false; otherwise.
|
|
</para>
|
|
<para>
|
|
See also <function>ctype_cntrl</function>, <function>ctype_graph</function>,
|
|
and <function>ctype_punct</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ctype-space">
|
|
<refnamediv>
|
|
<refname>ctype_space</refname>
|
|
<refpurpose>Check for whitespace character(s)</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ctype_space</methodname>
|
|
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if every character in <parameter>text</parameter>
|
|
creates some sort of white space, &false; otherwise. Besides the
|
|
blank character this also includes tab, vertical tab, line feed,
|
|
carriage return and formfeed characters.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ctype-upper">
|
|
<refnamediv>
|
|
<refname>ctype_upper</refname>
|
|
<refpurpose>Check for uppercase character(s)</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ctype_upper</methodname>
|
|
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if every character in <parameter>text</parameter> is
|
|
a uppercase letter in the current locale.
|
|
</para>
|
|
<para>
|
|
See also <function>ctype_alpha</function> and <function>ctype_lower</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ctype-xdigit">
|
|
<refnamediv>
|
|
<refname>ctype_xdigit</refname>
|
|
<refpurpose>
|
|
Check for character(s) representing a hexadecimal digit
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ctype_xdigit</methodname>
|
|
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if every character in <parameter>text</parameter> is
|
|
a hexadecimal 'digit', that is a decimal digit or a character from
|
|
<literal>[A-Fa-f]</literal> , &false; otherwise.
|
|
</para>
|
|
<para>
|
|
See also <function>ctype_digit</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
</reference>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|
|
|