mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
* inclusão de arquivos originais com revisão atualizada * tradução em recursivearrayiterator
108 lines
2.7 KiB
XML
108 lines
2.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: d51166ca16fda8e766849505b84f9306ef443f71 Maintainer: fernandowobeto Status: ready --><!-- CREDITS: fernandowobeto -->
|
|
<refentry xml:id="recursivearrayiterator.haschildren" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>RecursiveArrayIterator::hasChildren</refname>
|
|
<refpurpose>Retorna se a entrada atual é um array ou um objeto</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="RecursiveArrayIterator">
|
|
<modifier>public</modifier> <type>bool</type><methodname>RecursiveArrayIterator::hasChildren</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
Retorna se a entrada atual é um <type>array</type> ou um <type>object</type> para
|
|
o qual um iterador pode ser obtido via
|
|
<methodname>RecursiveArrayIterator::getChildren</methodname>.
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
&no.function.parameters;
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retorna &true; se a entrada atual é um <type>array</type> ou um <type>object</type>,
|
|
caso contrário, &false; é retornado.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>RecursiveArrayIterator::hasChildren</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$fruits = array("a" => "limão", "b" => "laranja", array("a" => "maçã", "p" => "pêra"));
|
|
|
|
$iterator = new RecursiveArrayIterator($fruits);
|
|
|
|
while ($iterator->valid()) {
|
|
|
|
// Verifica se há filhos
|
|
if ($iterator->hasChildren()) {
|
|
// imprime todos os filhos
|
|
foreach ($iterator->getChildren() as $key => $value) {
|
|
echo $key . ' : ' . $value . "\n";
|
|
}
|
|
} else {
|
|
echo "Sem filhos.\n";
|
|
}
|
|
|
|
$iterator->next();
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Sem filhos.
|
|
Sem filhos.
|
|
a : maçã
|
|
p : pêra
|
|
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>RecursiveArrayIterator::getChildren</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
|
|
-->
|