cvs: phpdoc-zh /reference/array/functions array-diff-assoc.xml array-intersect-assoc.xml
| From: | Dallas Thunder | Date: | Wed, 23 Apr 2003 05:57:27 +0000 |
| Subject: | cvs: phpdoc-zh /reference/array/functions array-diff-assoc.xml array-intersect-assoc.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-1376@lists.php.net to get a copy of this message | ||
dallas Wed Apr 23 01:57:27 2003 EDT
Added files:
/phpdoc-zh/reference/array/functions array-diff-assoc.xml
array-intersect-assoc.xml
Log:
Completed.
Index: phpdoc-zh/reference/array/functions/array-diff-assoc.xml
+++ phpdoc-zh/reference/array/functions/array-diff-assoc.xml
<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: dallas $ -->
<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready -->
<refentry id="function.array-diff-assoc">
<refnamediv>
<refname>array_diff_assoc</refname>
<refpurpose>´øË÷Òý¼ì²é¼ÆËãÊý×éµÄ²î¼¯</refpurpose>
</refnamediv>
<refsect1>
<title>˵Ã÷</title>
<methodsynopsis>
<type>array</type><methodname>array_diff_assoc</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_assoc</function> ·µ»ØÒ»¸ö
<type>array</type>£¬·µ»ØÒ»¸öÊý×飬¸ÃÊý×é°üÀ¨ÁËËùÓÐÔÚ
<parameter>array1</parameter>
Öе«ÊDz»ÔÚÈÎºÎÆäËü²ÎÊýÊý×éÖеÄÖµ¡£×¢ÒâºÍ
<function>array_diff</function> ²»Í¬µÄÊǼüÃûÒ²ÓÃÓڱȽϡ£
</para>
<para>
<example>
<title><function>array_diff_assoc</function> Àý×Ó</title>
<programlisting role="php">
<![CDATA[
<?php
$array1 = array ("a" => "green", "b" => "brown",
"c" => "blue", "red");
$array2 = array ("a" => "green", "yellow", "red");
$result = array_diff_assoc ($array1, $array2);
/* The result is:
Array
(
[b] => brown
[c] => blue
[0] => red
)
*/
?>
]]>
</programlisting>
</example>
</para>
<simpara>
ÉÏÃæµÄÀý×ÓÖпÉÒÔ¿´µ½¼üÖµ¶Ô <literal>"a" =>
"green"</literal>
ÔÚÁ½¸öÊý×éÖж¼ÓУ¬Òò´Ë²»ÔÚ±¾º¯ÊýµÄÊä³öÖС£Óë´Ë²»Í¬£¬¼üÖµ¶Ô
<literal>0 => "red"</literal>
³öÏÖÔÚÊä³öÖÐÊÇÒòΪµÚ¶þ¸ö²ÎÊýÖеÄ
<literal>"red"</literal> µÄ¼üÃûÊÇ
<literal>1</literal>¡£
</simpara>
<simpara>
¼üÖµ¶Ô <emphasis>key => value</emphasis>
ÖеÄÁ½¸öÖµ½öÔÚ <literal>(string) $elem1 === (string)
$elem2 </literal>
ʱ±»ÈÏΪÏàµÈ¡£Ò²¾ÍÊÇ˵ʹÓÃÁËÑϸñ¼ì²é£¬×Ö·û´®µÄ±í´ï±ØÐëÏàͬ¡£
<!-- TODO: example of it... -->
</simpara>
<note>
<simpara>
×¢Òâ´Ëº¯Êý½ö¼ì²é¶àάÊý×éÖеÄһά¡£µ±È»Äã¿ÉÒÔÓÃ
<literal>array_diff_assoc($array1[0], $array2[0]);</literal>
¼ì²é¸üÉîµÄά¶È¡£
</simpara>
</note>
<para>
²Î¼û
<function>array_diff</function>£¬<function>array_intersect</function>
ºÍ <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
-->
Index: phpdoc-zh/reference/array/functions/array-intersect-assoc.xml
+++ phpdoc-zh/reference/array/functions/array-intersect-assoc.xml
<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: dallas $ -->
<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready -->
<refentry id="function.array-intersect-assoc">
<refnamediv>
<refname>array_intersect_assoc</refname>
<refpurpose>´øË÷Òý¼ì²é¼ÆËãÊý×éµÄ½»¼¯</refpurpose>
</refnamediv>
<refsect1>
<title>˵Ã÷</title>
<methodsynopsis>
<type>array</type><methodname>array_intersect_assoc</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>
<simpara>
<function>array_intersect_assoc</function>
·µ»ØÒ»¸öÊý×飬¸ÃÊý×é°üº¬ÁËËùÓÐÔÚ
<parameter>array1</parameter>
ÖÐҲͬʱ³öÏÖÔÚËùÓÐÆäËü²ÎÊýÊý×éÖеÄÖµ¡£×¢ÒâºÍ
<function>array__intersect</function>
²»Í¬µÄÊǼüÃûÒ²ÓÃÓڱȽϡ£
</simpara>
<para>
<example>
<title><function>array_intersect_assoc</function> Àý×Ó</title>
<programlisting role="php">
<![CDATA[
<?php
$array1 = array ("a" => "green", "b" => "brown",
"c" => "blue", "red");
$array2 = array ("a" => "green", "yellow", "red");
$result_array = array_intersect_assoc ($array1, $array2);
/* $result_array will look like:
Array
(
[a] => green
)
*/
?>
]]>
</programlisting>
</example>
</para>
<simpara>
ÉÏÃæÀý×ÓÖпÉÒÔ¿´µ½¼üÖµ¶Ô <literal>"a" =>
"green"</literal> ÔÚÁ½¸öÊý×éÖж¼ÓÐÒò´Ë±»·µ»Ø¡£Öµ
<literal>"red"</literal> ûÓб»·µ»ØÊÇÒòΪÔÚ
<varname>$array1</varname> ÖÐËûµÄ¼üÃûÊÇ
<literal>2</literal>
¶øÔÚ <varname>$array2</varname> ÖÐ
<literal>"red"</literal>
µÄ¼üÃûÊÇ <literal>1</literal>¡£
</simpara>
<simpara>
¼üÖµ¶Ô <emphasis>key => value</emphasis>
ÖеÄÁ½¸öÖµ½öÔÚ <literal>(string) $elem1 === (string)
$elem2 </literal>
ʱ±»ÈÏΪÏàµÈ¡£Ò²¾ÍÊÇ˵ʹÓÃÁËÑϸñ¼ì²é£¬×Ö·û´®µÄ±í´ï±ØÐëÏàͬ¡£
<!-- TODO: example of it... -->
</simpara>
<simpara>
²Î¼û
<function>array_intersect</function>£¬<function>array_diff</function>
ºÍ <function>array_diff_assoc</function>¡£
</simpara>
</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
-->