reference/ctype/book.xml
1af58f6311e4884398f334e8dd7c5ac5131988ba
...
...
@@ -1,9 +1,8 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<!-- Purpose: basic.vartype -->
4
-
<!-- Membership: bundled -->
5
3

6
4
<book xml:id="book.ctype" xmlns="http://docbook.org/ns/docbook">
5
+
<?phpdoc extension-membership="bundled" ?>
7
6
<title>Character type checking</title>
8
7
<titleabbrev>Ctype</titleabbrev>
9
8

...
...
@@ -18,17 +17,17 @@
18
17
When called with an integer argument these functions
19
18
behave exactly like their C counterparts from
20
19
<filename>ctype.h</filename>.
21
-
It means that if you pass an integer smaller than 256 it will use the
20
+
It means that if an integer smaller than 256 is passed, it will use the
22
21
ASCII value of it to see if it fits in the specified range (digits are in
23
22
0x30-0x39). If the number is between -128 and -1 inclusive then 256 will
24
23
be added and the check will be done on that.
25
24
</para>
25
+
&note.ctype.parameter.non-string;
26
26
<para>
27
27
When called with a string argument they will check
28
28
every character in the string and will only return
29
29
&true; if every character in the string matches the
30
-
requested criteria. When called with an empty string
31
-
the result will always be &true; in PHP &lt; 5.1 and &false; since 5.1.
30
+
requested criteria. &ctype.result.empty-string;
32
31
</para>
33
32
<para>
34
33
Passing anything else but a string or integer will
...
...
@@ -36,10 +35,21 @@
36
35
</para>
37
36
<para>
38
37
It should be noted that ctype functions are always preferred over
39
-
regular expressions, and even to some equivalent str_* and is_* functions.
38
+
regular expressions, and even to some equivalent <literal>"str_*"</literal> and <literal>"is_*"</literal> functions.
40
39
This is because of the fact that ctype uses a native C library and thus
41
40
processes significantly faster.
42
41
</para>
42
+
<note>
43
+
<para>
44
+
These functions are not related to the Python "ctypes" library at all.
45
+
The extension name stems from the <filename>ctype.h</filename> C header
46
+
file that their C equivalents are defined in.
47
+
</para>
48
+
<para>
49
+
This extension also predates Python "ctypes" so any confusion
50
+
caused by this naming is hardly PHP's fault.
51
+
</para>
52
+
</note>
43
53
</preface>
44
54

45
55
&reference.ctype.setup;
46
56