cvs: phpdoc /en/reference/array/functions array-keys.xml

From: Date: Fri, 30 May 2003 17:10:53 +0000
Subject: cvs: phpdoc /en/reference/array/functions array-keys.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969354087@lists.php.net to get a copy of this message
philip Fri May 30 13:10:53 2003 EDT Modified files: /phpdoc/en/reference/array/functions array-keys.xml Log: Remove php3 example, and see also array_key_exists() Index: phpdoc/en/reference/array/functions/array-keys.xml diff -u phpdoc/en/reference/array/functions/array-keys.xml:1.5 phpdoc/en/reference/array/functions/array-keys.xml:1.6 --- phpdoc/en/reference/array/functions/array-keys.xml:1.5 Sat May 17 22:32:19 2003 +++ phpdoc/en/reference/array/functions/array-keys.xml Fri May 30 13:10:53 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 --> <refentry id="function.array-keys"> <refnamediv> @@ -29,6 +29,7 @@ <title><function>array_keys</function> example</title> <programlisting role="php"> <![CDATA[ +<?php $array = array (0 => 100, "color" => "red"); print_r(array_keys ($array)); @@ -38,6 +39,7 @@ $array = array ("color" => array("blue", "red", "green"), "size" => array("small", "medium", "large")); print_r(array_keys ($array)); +?> ]]> </programlisting> <para> @@ -65,34 +67,9 @@ </para> </example> </para> - <note> - <para> - This function was added to PHP 4, below is an implementation for - those still using PHP 3. - <example> - <title> - Implementation of <function>array_keys</function> for PHP 3 - users - </title> - <programlisting role="php"> -<![CDATA[ -function array_keys ($arr, $term="") { - $t = array(); - while (list($k,$v) = each($arr)) { - if ($term && $v != $term) { - continue; - } - $t[] = $k; - } - return $t; -} -]]> - </programlisting> - </example> - </para> - </note> <para> - See also <function>array_values</function>. + See also <function>array_values</function> and + <function>array_key_exists</function>. </para> </refsect1> </refentry>

« previous php.doc (#969354087) next »