1
0
mirror of https://github.com/php/doc-zh.git synced 2026-03-27 00:22:13 +01:00
Files
archived-doc-zh/reference/array/functions/array-values.xml
Dallas Wang 630ac05213 Translation completed.
git-svn-id: https://svn.php.net/repository/phpdoc/zh/trunk@95449 c90b9560-bf6c-de11-be94-00142212c4b1
2002-09-11 05:04:54 +00:00

90 lines
2.0 KiB
XML
Executable File

<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: dallas $ -->
<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready -->
<refentry id="function.array-values">
<refnamediv>
<refname>array_values</refname>
<refpurpose>返回数组中所有的值</refpurpose>
</refnamediv>
<refsect1>
<title>说明</title>
<methodsynopsis>
<type>array</type><methodname>array_values</methodname>
<methodparam><type>array</type><parameter>input</parameter></methodparam>
</methodsynopsis>
<para>
<function>array_values</function> 返回
<parameter>input</parameter> 数组中所有的值。
</para>
<para>
<example>
<title><function>array_values</function> 例子</title>
<programlisting role="php">
<![CDATA[
$array = array ("size" => "XL", "color" => "gold");
print_r(array_values ($array));
]]>
</programlisting>
<para>
上例将输出:
<screen role="php">
<![CDATA[
Array
(
[0] => XL
[1] => gold
)
]]>
</screen>
</para>
</example>
</para>
<note>
<para>
本函数是 PHP 4 新加的,以下是 PHP 3 的实现:
<example>
<title>
<function>array_values</function> 对PHP 3 用户的实现
</title>
<programlisting role="php">
<![CDATA[
function array_values ($arr) {
$t = array();
while (list($k, $v) = each ($arr)) {
$t[] = $v;
}
return $t;
}
]]>
</programlisting>
</example>
</para>
</note>
<para>
参见 <function>array_keys</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
-->