reference/ctype/functions/ctype-space.xml
e20e74073379710a4f6316734c42996c8fbf9beb
...
...
@@ -11,10 +11,10 @@
11
11
&reftitle.description;
12
12
<methodsynopsis>
13
13
<type>bool</type><methodname>ctype_space</methodname>
14
-
<methodparam><type>string</type><parameter>text</parameter></methodparam>
14
+
<methodparam><type>mixed</type><parameter>text</parameter></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
-
Checks if all of the characters in the provided string,
17
+
Checks if all of the characters in the provided <type>string</type>,
18
18
<parameter>text</parameter>, creates whitespace.
19
19
</para>
20
20
</refsect1>
...
...
@@ -28,6 +28,8 @@
28
28
<listitem>
29
29
<para>
30
30
The tested string.
31
+
&note.ctype.parameter.integer;
32
+
&note.ctype.parameter.non-string;
31
33
</para>
32
34
</listitem>
33
35
</varlistentry>
...
...
@@ -42,6 +44,7 @@
42
44
creates some sort of white space, &false; otherwise. Besides the
43
45
blank character this also includes tab, vertical tab, line feed,
44
46
carriage return and form feed characters.
47
+
&ctype.result.empty-string;
45
48
</para>
46
49
</refsect1>
47
50

...
...
@@ -53,12 +56,16 @@
53
56
<programlisting role="php">
54
57
<![CDATA[
55
58
<?php
56
-
$strings = array('string1' => "\n\r\t", 'string2' => "\narf12", 'string3' => '\n\r\t');
59
+
$strings = array(
60
+
'string1' => "\n\r\t",
61
+
'string2' => "\narf12",
62
+
'string3' => '\n\r\t' // note the single quotes
63
+
);
57
64
foreach ($strings as $name => $testcase) {
58
65
if (ctype_space($testcase)) {
59
-
echo "The string '$name' consists of all whitespace characters.\n";
66
+
echo "The string '$name' consists of whitespace characters only.\n";
60
67
} else {
61
-
echo "The string '$name' does not consist of all whitespace characters.\n";
68
+
echo "The string '$name' contains non-whitespace characters.\n";
62
69
}
63
70
}
64
71
?>
...
...
@@ -67,9 +74,9 @@ foreach ($strings as $name => $testcase) {
67
74
&example.outputs;
68
75
<screen>
69
76
<![CDATA[
70
-
The string 'string1' consists of all whitespace characters.
71
-
The string 'string2' does not consist of all whitespace characters.
72
-
The string 'string3' does not consist of all whitespace characters.
77
+
The string 'string1' consists of whitespace characters only.
78
+
The string 'string2' contains non-whitespace characters.
79
+
The string 'string3' contains non-whitespace characters.
73
80
]]>
74
81
</screen>
75
82
</example>
...
...
@@ -83,6 +90,7 @@ The string 'string3' does not consist of all whitespace characters.
83
90
<member><function>ctype_cntrl</function></member>
84
91
<member><function>ctype_graph</function></member>
85
92
<member><function>ctype_punct</function></member>
93
+
<member><function>IntlChar::isspace</function></member>
86
94
</simplelist>
87
95
</para>
88
96
</refsect1>
89
97