mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 17:08:54 +00:00
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:
parent
7afa7236ba
commit
136f5cc464
1 changed files with 5 additions and 2 deletions
|
@ -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 && $k != $term)
|
||||
continue;
|
||||
$t[] = $k;
|
||||
}
|
||||
return $t;
|
||||
}
|
||||
</programlisting>
|
||||
|
|
Loading…
Reference in a new issue