reference/spl/limititerator/getposition.xml
d51166ca16fda8e766849505b84f9306ef443f71
...
...
@@ -1,4 +1,4 @@
1
-
<?xml version='1.0' encoding='iso-8859-1'?>
1
+
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
3
<refentry xml:id="limititerator.getposition" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
...
...
@@ -8,13 +8,13 @@
8
8

9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
-
<methodsynopsis>
12
-
<type>int</type><methodname>LimitIterator::getPosition</methodname>
11
+
<methodsynopsis role="LimitIterator">
12
+
<modifier>public</modifier> <type>int</type><methodname>LimitIterator::getPosition</methodname>
13
13
<void/>
14
14
</methodsynopsis>
15
-

16
-
&warn.undocumented.func;
17
-

15
+
<para>
16
+
Gets the current zero-based position of the inner <classname>Iterator</classname>.
17
+
</para>
18
18
</refsect1>
19
19

20
20
<refsect1 role="parameters">
...
...
@@ -29,8 +29,51 @@
29
29
</para>
30
30
</refsect1>
31
31

32
-
</refentry>
32
+
<refsect1 role="examples">
33
+
&reftitle.examples;
34
+
<para>
35
+
<example>
36
+
<title><function>LimitIterator::getPosition</function> example</title>
37
+
<programlisting role="php">
38
+
<![CDATA[
39
+
<?php
40
+
$fruits = array(
41
+
'a' => 'apple',
42
+
'b' => 'banana',
43
+
'c' => 'cherry',
44
+
'd' => 'damson',
45
+
'e' => 'elderberry'
46
+
);
47
+
$array_it = new ArrayIterator($fruits);
48
+
$limit_it = new LimitIterator($array_it, 2, 3);
49
+
foreach ($limit_it as $item) {
50
+
echo $limit_it->getPosition() . ' ' . $item . "\n";
51
+
}
52
+
?>
53
+
]]>
54
+
</programlisting>
55
+
&example.outputs;
56
+
<screen>
57
+
<![CDATA[
58
+
2 cherry
59
+
3 damson
60
+
4 elderberry
61
+
]]>
62
+
</screen>
63
+
</example>
64
+
</para>
65
+
</refsect1>
66
+

67
+
<refsect1 role="seealso">
68
+
&reftitle.seealso;
69
+
<para>
70
+
<simplelist>
71
+
<member><methodname>FilterIterator::key</methodname></member>
72
+
</simplelist>
73
+
</para>
74
+
</refsect1>
33
75

76
+
</refentry>
34
77
<!-- Keep this comment at the end of the file
35
78
Local variables:
36
79
mode: sgml
37
80