nlopess         Tue Apr 13 11:14:06 2004 EDT

  Modified files:              
    /phpdoc/en/reference/spl/functions  ArrayIterator-key.xml 
                                        ArrayIterator-next.xml 
                                        ArrayIterator-rewind.xml 
  Log:
  completing spl/array docs
  
http://cvs.php.net/diff.php/phpdoc/en/reference/spl/functions/ArrayIterator-key.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/spl/functions/ArrayIterator-key.xml
diff -u phpdoc/en/reference/spl/functions/ArrayIterator-key.xml:1.2 
phpdoc/en/reference/spl/functions/ArrayIterator-key.xml:1.3
--- phpdoc/en/reference/spl/functions/ArrayIterator-key.xml:1.2 Sun Apr 11 10:54:24 
2004
+++ phpdoc/en/reference/spl/functions/ArrayIterator-key.xml     Tue Apr 13 11:14:06 
2004
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
   <refentry id="function.ArrayIterator-key">
    <refnamediv>
     <refname>ArrayIterator::key</refname>
@@ -13,9 +13,26 @@
      <type>mixed</type><methodname>ArrayIterator::key</methodname>
      <void/>
     </methodsynopsis>
+    <para>
+     This function returns the current array key
+    </para>
+    <para>
+     <example>
+      <title><function>ArrayIterator::key</function> example</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$array = array('key' => 'value');
 
-     &warn.undocumented.func;
+$arrayobject = new ArrayObject($array);
+$iterator = $arrayobject->getIterator();
 
+echo $iterator->key(); //key
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
    </refsect1>
   </refentry>
 
http://cvs.php.net/diff.php/phpdoc/en/reference/spl/functions/ArrayIterator-next.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc/en/reference/spl/functions/ArrayIterator-next.xml
diff -u phpdoc/en/reference/spl/functions/ArrayIterator-next.xml:1.1 
phpdoc/en/reference/spl/functions/ArrayIterator-next.xml:1.2
--- phpdoc/en/reference/spl/functions/ArrayIterator-next.xml:1.1        Tue Feb 24 
05:51:40 2004
+++ phpdoc/en/reference/spl/functions/ArrayIterator-next.xml    Tue Apr 13 11:14:06 
2004
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
   <refentry id="function.ArrayIterator-next">
    <refnamediv>
     <refname>ArrayIterator::next</refname>
@@ -13,9 +13,41 @@
      <type>void</type><methodname>ArrayIterator::next</methodname>
      <void/>
     </methodsynopsis>
+    <para>
+     This function moves the iterator to the next entry.
+    </para>
+    <para>
+     <example>
+      <title><function>ArrayIterator::next</function> example</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$arrayobject = new ArrayObject();
 
-     &warn.undocumented.func;
+$arrayobject[] = 'zero';
+$arrayobject[] = 'one';
 
+$iterator = $arrayobject->getIterator();
+
+while($iterator->valid()) {
+    echo $iterator->key() . ' => ' . $iterator->current() . "\n";
+
+    $iterator->next();
+}
+?>
+]]>
+      </programlisting>
+      <para>
+       The above example will output:
+      </para>
+      <screen>
+<![CDATA[
+0 => zero
+1 => one
+]]>
+      </screen>
+     </example>
+    </para>
    </refsect1>
   </refentry>
 
http://cvs.php.net/diff.php/phpdoc/en/reference/spl/functions/ArrayIterator-rewind.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc/en/reference/spl/functions/ArrayIterator-rewind.xml
diff -u phpdoc/en/reference/spl/functions/ArrayIterator-rewind.xml:1.1 
phpdoc/en/reference/spl/functions/ArrayIterator-rewind.xml:1.2
--- phpdoc/en/reference/spl/functions/ArrayIterator-rewind.xml:1.1      Tue Feb 24 
05:51:40 2004
+++ phpdoc/en/reference/spl/functions/ArrayIterator-rewind.xml  Tue Apr 13 11:14:06 
2004
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
   <refentry id="function.ArrayIterator-rewind">
    <refnamediv>
     <refname>ArrayIterator::rewind</refname>
@@ -13,9 +13,33 @@
      <type>void</type><methodname>ArrayIterator::rewind</methodname>
      <void/>
     </methodsynopsis>
+    <para>
+     This function rewinds the iterator to the begining.
+    </para>
+    <para>
+     <example>
+      <title><function>ArrayObject::rewind</function> example</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+$arrayobject = new ArrayObject();
 
-     &warn.undocumented.func;
+$arrayobject[] = 'zero';
+$arrayobject[] = 'one';
+$arrayobject[] = 'two';
 
+$iterator = $arrayobject->getIterator();
+
+$iterator->next();
+echo $iterator->key(); //1
+
+$iterator->rewind(); //rewinding to the begining
+echo $iterator->key(); //0
+?>
+]]>
+      </programlisting>
+     </example>
+    </para>
    </refsect1>
   </refentry>
 

Reply via email to