mirror of
https://github.com/php/doc-fr.git
synced 2026-03-24 07:02:06 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@223533 c90b9560-bf6c-de11-be94-00142212c4b1
85 lines
2.3 KiB
XML
85 lines
2.3 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.20 $ -->
|
|
<!-- EN-Revision: 1.11 Maintainer: dams Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry id="function.array-intersect">
|
|
<refnamediv>
|
|
<refname>array_intersect</refname>
|
|
<refpurpose>Calcule l'intersection de tableaux</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<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ésentes dans tous les autres arguments <parameter>array2</parameter>,
|
|
<parameter>...</parameter>, etc. Notez que les clés sont préservé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>
|
|
&example.outputs;
|
|
<screen role="php">
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[a] => vert
|
|
[0] => rouge
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<note>
|
|
<simpara>
|
|
Deux éléments sont considérés comme égaux
|
|
si et seulement si <literal>(string) $elem1 === (string) $elem2</literal>. En clair :
|
|
lorsque la représentation en chaîne de caractères est identique.
|
|
</simpara>
|
|
</note>
|
|
<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
|
|
-->
|