From 136f5cc4649fce810dd788ded9ef91231bf34674 Mon Sep 17 00:00:00 2001 From: "Jesus M. Castagnetto" Date: Fri, 8 Sep 2000 19:27:11 +0000 Subject: [PATCH] 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 --- functions/array.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/functions/array.xml b/functions/array.xml index 715cc60a79..8822f7266f 100644 --- a/functions/array.xml +++ b/functions/array.xml @@ -259,10 +259,13 @@ array_keys ($array, "blue"); // returns array (0, 3, 4) PHP3 users -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; }