mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 15:32:36 +01:00
- All id attributes are now xml:id - Add docbook namespace to all root elements - Replace <ulink /> with <link xlink:href /> - Minor markup fixes here and there - Bump EN-Revision where appropriate git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@238324 c90b9560-bf6c-de11-be94-00142212c4b1
91 lines
3.1 KiB
XML
91 lines
3.1 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.3 $ -->
|
|
<!-- EN-Revision: 1.7 Maintainer: reven Status: ready -->
|
|
<!-- splitted from ./en/functions/array.xml, last change in rev 1.14 -->
|
|
<refentry xml:id="function.array-diff" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>array_diff</refname>
|
|
<refpurpose>Comprueba las diferencias entre matrices</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Descripción</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_diff</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_diff</function> devuelve una matriz que contiene todos
|
|
los valores de <parameter>array1</parameter> que no aparezcan en ninguna de
|
|
las otras matrices que se pasan a la función como argumento. Hay que
|
|
tener en cuenta que las claves se mantienen.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>array_diff</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
$array1 = array ("a" => "verde", "rojo", "azul", "rojo");
|
|
$array2 = array ("b" => "verde", "amarillo", "rojo");
|
|
$resultado = array_diff ($array1, $array2);
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Lo cual hace que <varname>$resultado</varname> contenga la matriz
|
|
<literal>array ("azul");</literal>. Multiples ocurrencias en $array1
|
|
son tratadas todas de la misma forma.
|
|
</para>
|
|
<note>
|
|
<simpara>
|
|
Dos elementos se consideran equivalentes si y sólo si
|
|
<literal>(string) $elem1 === (string) $elem2</literal>, es decir,
|
|
cuando la representación de cadena es la misma.
|
|
<!-- TODO: example of it... -->
|
|
</simpara>
|
|
</note>
|
|
<note>
|
|
<simpara>
|
|
Hay que tener en cuenta que esta función sólo comprueba
|
|
una dimensión de una matriz n-dimensional. Por supuesto, se
|
|
pueden comprobar dimensiones sucesivas mediante:
|
|
<literal>array_diff($array1[0], $array2[0]);</literal>.
|
|
</simpara>
|
|
</note>
|
|
<warning>
|
|
<simpara>
|
|
Esta función se rompió en PHP 4.0.4!
|
|
<!-- TODO: when exactly was this broken?... -->
|
|
</simpara>
|
|
</warning>
|
|
<para>
|
|
Véase también <function>array_diff_assoc</function>,
|
|
<function>array_intersect</function> y
|
|
<function>array_intersect_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
|
|
-->
|