mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Remove php3 example, and see also array_key_exists()
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@129428 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
11d7071ffd
commit
3a30ba206e
1 changed files with 5 additions and 28 deletions
|
@ -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 @@ print_r(array_keys ($array, "blue"));
|
|||
$array = array ("color" => array("blue", "red", "green"),
|
||||
"size" => array("small", "medium", "large"));
|
||||
print_r(array_keys ($array));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
|
@ -65,34 +67,9 @@ Array
|
|||
</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>
|
||||
|
|
Loading…
Reference in a new issue