php-doc-en/reference/spl/recursiveregexiterator/getchildren.xml
2011-08-16 11:38:58 +00:00

111 lines
2.7 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!-- $Revision$ -->
<refentry xml:id="recursiveregexiterator.getchildren" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>RecursiveRegexIterator::getChildren</refname>
<refpurpose>Returns an iterator for the current entry.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>RecursiveRegexIterator</type><methodname>RecursiveRegexIterator::getChildren</methodname>
<void/>
</methodsynopsis>
<para>
Returns an iterator for the current iterator entry.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
An iterator for the current entry, if it can be iterated over by the inner iterator.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
An <classname>InvalidArgumentException</classname>
will be thrown if the current entry does not contain a value that can be iterated over by
the inner iterator.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>RecursiveRegexIterator::getChildren</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5')));
$rRegexIterator = new RecursiveRegexIterator($rArrayIterator, '/^test/',
RecursiveRegexIterator::ALL_MATCHES);
foreach ($rRegexIterator as $key1 => $value1) {
if ($rRegexIterator->hasChildren()) {
// print all children
echo "Children: ";
foreach ($rRegexIterator->getChildren() as $key => $value) {
echo $value . " ";
}
echo "\n";
} else {
echo "No children\n";
}
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
No children
Children: test4 test5
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>RecursiveRegexIterator::hasChildren</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- 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
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
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
-->