1
0
mirror of https://github.com/php/doc-fr.git synced 2026-03-24 07:02:06 +01:00
Files
archived-doc-fr/reference/array/functions/array-intersect.xml
Damien Seguy 9c92b20ccb spring commit
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@118985 c90b9560-bf6c-de11-be94-00142212c4b1
2003-03-05 00:08:12 +00:00

91 lines
2.6 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- splitted from ./fr/functions/array.xml, last change in rev 1.30 -->
<!-- last change to 'array-intersect' in en/ tree in rev 1.14 -->
<refentry id="function.array-intersect">
<refnamediv>
<refname>array_intersect</refname>
<refpurpose>Calcule l'intersection de tableaux</refpurpose>
</refnamediv>
<refsect1>
<title>Description</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> retourne un tableau
contenant toutes les valeurs de <parameter>array1</parameter>
qui sont pr&eacute;sentes dans tous les autres arguments.
Notez que les cl&eacute;s sont pr&eacute;serv&eacute;es.
</para>
<para>
<example>
<title>Exemple avec <function>array_intersect</function></title>
<programlisting role="php">
<![CDATA[
<?php
$array1 = array ("a" => "vert", "rouge", "bleu");
$array2 = array ("b" => "vert", "jaune", "rouge");
$result = array_intersect ($array1, $array2);
print_r($result);
?>
]]>
</programlisting>
<para>
<varname>$result</varname> vaut :
<screen role="php">
<![CDATA[
Array
(
[a] => vert
[0] => rouge
)
]]>
</screen>
</para>
</example>
</para>
<note>
<simpara>
Deux &eacute;l&eacute;ments sont consid&eacute;r&eacute;s comme &eacute;gaux
si et seulement si <literal>(string) $elem1 === (string) $elem2</literal>. En clair :
lorsque la repr&eacute;sentation en cha&icirc;ne de caract&egrave;res est identique.
</simpara>
</note>
<warning>
<simpara>
Cette fonction &eacute;tait bogu&eacute;e en PHP 4.0.4!
</simpara>
</warning>
<para>
Voir aussi
<function>array_intersect_assoc</function>,
<function>array_diff</function> et
<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
-->