Files
archived-doc-pt-br/reference/array/functions/array-intersect.xml
T
Raphael M O B Sales "Narigone f44ad4023f Updating of files formerly belonging to Lucas Rocha (lucasr)
git-svn-id: https://svn.php.net/repository/phpdoc/pt_BR/trunk@235802 c90b9560-bf6c-de11-be94-00142212c4b1
2007-05-17 07:45:17 +00:00

84 lines
2.4 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- EN-Revision: 1.12 Maintainer: narigone Status: ready -->
<!-- CREDITS: lucasr -->
<!-- splitted from ./en/functions/array.xml, last change in rev 1.14 -->
<refentry id="function.array-intersect">
<refnamediv>
<refname>array_intersect</refname>
<refpurpose>Calcula a interseção entre arrays</refpurpose>
</refnamediv>
<refsect1>
<title>Descrição</title>
<methodsynopsis>
<type>array</type><methodname>array_intersect</methodname>
<methodparam><type>array</type><parameter>array1</parameter></methodparam>
<methodparam><type>array</type><parameter>array2</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter> ...</parameter></methodparam>
</methodsynopsis>
<para>
<function>array_intersect</function> retorna um array
contendo todos os valores de <parameter>array1</parameter>
que estão presentes nos outros argumentos.
Note que as chaves são preservadas.
</para>
<para>
<example>
<title>Exemplo de <function>array_intersect</function></title>
<programlisting role="php">
<![CDATA[
<?php
$array1 = array("a" => "verde", "vermelho", "azul");
$array2 = array("b" => "verde", "amarelo", "vermelho");
$result = array_intersect($array1, $array2);
print_r($result);
?>
]]>
</programlisting>
&example.outputs;
<screen role="php">
<![CDATA[
Array
(
[a] => verde
[0] => vermelho
)
]]>
</screen>
</example>
</para>
<note>
<simpara>
Dois elementos são considerados iguais se, e somente se,
<literal>(string) $elem1 === (string) $elem2</literal>. Em palavras:
quando a representação em string é a mesma.
<!-- TODO: example of it... -->
</simpara>
</note>
<para>
Veja também <function>array_intersect_assoc</function>, <function>array_diff</function>
e <function>array_diff_assoc</function>.
</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:"../../../../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
-->