Modified array_keys example for PHP3 users to include the 2nd parameter

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@32276 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jesus M. Castagnetto 2000-09-08 19:27:11 +00:00
parent 7afa7236ba
commit 136f5cc464

View file

@ -259,10 +259,13 @@ array_keys ($array, "blue"); // returns array (0, 3, 4)
PHP3 users
</title>
<programlisting role="php">
function array_keys($arr) {
function array_keys($arr, $term="") {
$t = array();
while (list($k,$v) = each($arr))
while (list($k,$v) = each($arr)) {
if ($term &amp;&amp; $k != $term)
continue;
$t[] = $k;
}
return $t;
}
</programlisting>