2014-09-05 07:44:07 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 08:59:47 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-12-24 12:30:24 +00:00
|
|
|
<refentry xml:id="arrayobject.getiterator" xmlns="http://docbook.org/ns/docbook">
|
2007-01-28 20:13:03 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>ArrayObject::getIterator</refname>
|
|
|
|
<refpurpose>Create a new iterator from an ArrayObject instance</refpurpose>
|
|
|
|
</refnamediv>
|
2008-03-20 01:25:04 +00:00
|
|
|
|
2007-12-24 12:30:24 +00:00
|
|
|
<refsect1 role="description">
|
2008-03-20 01:25:04 +00:00
|
|
|
&reftitle.description;
|
2007-01-28 20:13:03 +00:00
|
|
|
<methodsynopsis>
|
2012-01-17 08:20:53 +00:00
|
|
|
<modifier>public</modifier> <type>ArrayIterator</type><methodname>ArrayObject::getIterator</methodname>
|
2007-01-28 20:13:03 +00:00
|
|
|
<void/>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2008-03-20 01:25:04 +00:00
|
|
|
Create a new iterator from an <classname>ArrayObject</classname> instance.
|
2007-01-28 20:13:03 +00:00
|
|
|
</para>
|
2008-03-20 01:25:04 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
&no.function.parameters;
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
An iterator from an <classname>ArrayObject</classname>.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2007-01-28 20:13:03 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>ArrayObject::getIterator</function> example</title>
|
|
|
|
<programlisting role="php">
|
2004-04-13 14:20:11 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$array = array('1' => 'one',
|
|
|
|
'2' => 'two',
|
|
|
|
'3' => 'three');
|
2004-02-24 10:51:40 +00:00
|
|
|
|
2004-04-13 14:20:11 +00:00
|
|
|
$arrayobject = new ArrayObject($array);
|
2004-02-24 10:51:40 +00:00
|
|
|
|
2004-04-13 14:20:11 +00:00
|
|
|
$iterator = $arrayobject->getIterator();
|
|
|
|
|
|
|
|
while($iterator->valid()) {
|
|
|
|
echo $iterator->key() . ' => ' . $iterator->current() . "\n";
|
|
|
|
|
|
|
|
$iterator->next();
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
]]>
|
2007-01-28 20:13:03 +00:00
|
|
|
</programlisting>
|
2008-03-20 01:25:04 +00:00
|
|
|
&example.outputs;
|
2007-01-28 20:13:03 +00:00
|
|
|
<screen>
|
2004-04-13 14:20:11 +00:00
|
|
|
<![CDATA[
|
|
|
|
1 => one
|
|
|
|
2 => two
|
|
|
|
3 => three
|
|
|
|
]]>
|
2007-01-28 20:13:03 +00:00
|
|
|
</screen>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2004-02-24 10:51:40 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2004-02-24 10:51:40 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|