reference/strings/functions/sscanf.xml
4225e50bc391ddba99e367c231463da0dc04357d
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.sscanf" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+
<refentry xml:id="function.sscanf" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4
4
<refnamediv>
5
5
<refname>sscanf</refname>
6
6
<refpurpose>Parses input from a string according to a format</refpurpose>
...
...
@@ -9,21 +9,20 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>mixed</type><methodname>sscanf</methodname>
13
-
<methodparam><type>string</type><parameter>str</parameter></methodparam>
12
+
<type class="union"><type>array</type><type>int</type><type>null</type></type><methodname>sscanf</methodname>
13
+
<methodparam><type>string</type><parameter>string</parameter></methodparam>
14
14
<methodparam><type>string</type><parameter>format</parameter></methodparam>
15
-
<methodparam choice="opt"><type>mixed</type><parameter role="reference">...</parameter></methodparam>
15
+
<methodparam rep="repeat"><type>mixed</type><parameter role="reference">vars</parameter></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
The function <function>sscanf</function> is the input analog of
19
19
<function>printf</function>. <function>sscanf</function> reads
20
-
from the string <parameter>str</parameter> and interprets it
21
-
according to the specified <parameter>format</parameter>, which is
22
-
described in the documentation for <function>sprintf</function>.
20
+
from the string <parameter>string</parameter> and interprets it
21
+
according to the specified <parameter>format</parameter>.
23
22
</para>
24
23
<para>
25
24
Any whitespace in the format string matches any whitespace in the input
26
-
string. This means that even a tab \t in the format string can match a
25
+
string. This means that even a tab (<literal>\t</literal>) in the format string can match a
27
26
single space character in the input string.
28
27
</para>
29
28
</refsect1>
...
...
@@ -33,24 +32,16 @@
33
32
<para>
34
33
<variablelist>
35
34
<varlistentry>
36
-
<term><parameter>str</parameter></term>
35
+
<term><parameter>string</parameter></term>
37
36
<listitem>
38
37
<para>
39
38
The input <type>string</type> being parsed.
40
39
</para>
41
40
</listitem>
42
41
</varlistentry>
42
+
&strings.scanf.parameter.format;
43
43
<varlistentry>
44
-
<term><parameter>format</parameter></term>
45
-
<listitem>
46
-
<para>
47
-
The interpreted format for <parameter>str</parameter>, which is
48
-
described in the documentation for <function>sprintf</function>.
49
-
</para>
50
-
</listitem>
51
-
</varlistentry>
52
-
<varlistentry>
53
-
<term><parameter>...</parameter></term>
44
+
<term><parameter>vars</parameter></term>
54
45
<listitem>
55
46
<para>
56
47
Optionally pass in variables by reference that will contain the parsed values.
...
...
@@ -64,11 +55,15 @@
64
55
<refsect1 role="returnvalues">
65
56
&reftitle.returnvalues;
66
57
<para>
67
-
If only
68
-
two parameters were passed to this function, the values parsed
69
-
will be returned as an array. Otherwise, if optional parameters are passed,
70
-
the function will return the number of assigned values. The optional
71
-
parameters must be passed by reference.
58
+
If only two parameters were passed to this function, the values parsed will
59
+
be returned as an array. Otherwise, if optional parameters are passed, the
60
+
function will return the number of assigned values. The optional parameters
61
+
must be passed by reference.
62
+
</para>
63
+
<para>
64
+
If there are more substrings expected in the <parameter>format</parameter>
65
+
than there are available within <parameter>string</parameter>,
66
+
&null; will be returned.
72
67
</para>
73
68
</refsect1>
74
69

...
...
@@ -119,15 +114,20 @@ echo "<author id='$id'>
119
114
&reftitle.seealso;
120
115
<para>
121
116
<simplelist>
122
-
<member><function>fscanf</function></member>
123
117
<member><function>printf</function></member>
124
118
<member><function>sprintf</function></member>
119
+
<member><function>fprintf</function></member>
120
+
<member><function>vprintf</function></member>
121
+
<member><function>vsprintf</function></member>
122
+
<member><function>vfprintf</function></member>
123
+
<member><function>fscanf</function></member>
124
+
<member><function>number_format</function></member>
125
+
<member><function>date</function></member>
125
126
</simplelist>
126
127
</para>
127
128
</refsect1>
128
129

129
130
</refentry>
130
-

131
131
<!-- Keep this comment at the end of the file
132
132
Local variables:
133
133
mode: sgml
134
134