mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
added some structure to the info and finaly decided to have
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
This commit is contained in:
parent
6fa1adcca5
commit
809b771749
1 changed files with 168 additions and 64 deletions
|
@ -1,22 +1,19 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.18 $ -->
|
||||
<!-- $Revision: 1.19 $ -->
|
||||
<reference id="ref.ctype">
|
||||
<title>Character type functions</title>
|
||||
<titleabbrev>ctype</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
<para>
|
||||
These functions check whether a character or string
|
||||
falls into a certain character class according to the
|
||||
current locale.
|
||||
</para>
|
||||
<para>
|
||||
To get these functions to work, you must have compiled PHP
|
||||
with <option role="configure">--enable-ctype</option>.
|
||||
|
||||
<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.
|
||||
behave exactly like their C counterparts from "ctype.h".
|
||||
</para>
|
||||
<para>
|
||||
When called with a string argument they will check
|
||||
|
@ -28,6 +25,45 @@
|
|||
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>
|
||||
|
||||
|
||||
|
@ -38,16 +74,23 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_alnum</methodname>
|
||||
<methodparam><type>string</type><parameter>c</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_alnum</methodname>
|
||||
<methodparam><type>string</type><parameter>text</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
See also <function>setlocale</function>.
|
||||
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>
|
||||
|
@ -55,15 +98,27 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_alpha</methodname>
|
||||
<methodparam><type>string</type><parameter>c</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>
|
||||
|
@ -71,15 +126,18 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_cntrl</methodname>
|
||||
<methodparam><type>string</type><parameter>c</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>
|
||||
|
@ -87,15 +145,20 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_digit</methodname>
|
||||
<methodparam><type>string</type><parameter>c</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>
|
||||
|
@ -103,15 +166,20 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_lower</methodname>
|
||||
<methodparam><type>string</type><parameter>c</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>
|
||||
|
@ -119,15 +187,22 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_graph</methodname>
|
||||
<methodparam><type>string</type><parameter>c</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>
|
||||
|
@ -135,15 +210,23 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_print</methodname>
|
||||
<methodparam><type>string</type><parameter>c</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>
|
||||
|
@ -154,15 +237,21 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_punct</methodname>
|
||||
<methodparam><type>string</type><parameter>c</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>
|
||||
|
@ -170,15 +259,19 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_space</methodname>
|
||||
<methodparam><type>string</type><parameter>c</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>
|
||||
|
@ -186,11 +279,16 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_upper</methodname>
|
||||
<methodparam><type>string</type><parameter>c</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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>
|
||||
|
@ -204,15 +302,21 @@
|
|||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>ctype_xdigit</methodname>
|
||||
<methodparam><type>string</type><parameter>c</parameter></methodparam>
|
||||
<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
|
||||
|
|
Loading…
Reference in a new issue