1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.20 $ -->
<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 function, &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
-->
|