From eb5e3c9b8a016ac852c1d9b338212b5596e753df Mon Sep 17 00:00:00 2001 From: Gabor Hojtsy Date: Sun, 11 Nov 2001 11:02:32 +0000 Subject: [PATCH] Documenting two functions: array_change_key_case key_exists with examples... git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@61965 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/array.xml | 86 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/functions/array.xml b/functions/array.xml index e12597dfe7..4456883ea9 100644 --- a/functions/array.xml +++ b/functions/array.xml @@ -1,5 +1,5 @@ - + Array Functions Arrays @@ -134,6 +134,53 @@ Array + + + array_change_key_case + Retuns an array with all string keys lowercased or uppercased + + + Description + + + array array_change_key_case + array input + int case + + + + array_change_key_case changes the + keys in the input array to + be all lowercase or uppercase. The change depends + on the last optional case + parameter. You can pass two constants there, + CASE_UPPER and + CASE_LOWER. The default is + CASE_LOWER. The function will leave + number indices as is. + + + + <function>array_change_key_case</function> example + +$input_array = array("FirSt" => 1, "SecOnd" => 4); +print_r(array_change_key_case($input_array, CASE_UPPER); + + + The printout of the above program will be: + + +Array +( + [FIRST] => 1 + [SECOND] => 2 +) + + + + + + array_chunk @@ -2508,6 +2555,43 @@ if (in_array(1.13, $a, TRUE)) + + + key_exists + Checks if the given key or index exists in the array + + + Description + + + bool key_exists + mixed key + array search + + + + key_exists returns &true; if the + given key is set in the array. + key can be any value possible + for an array index. + + + + <function>key_exists</function> example + +$search_array = array("first" => 1, "second" => 4); +if (key_exists("first", $search_array)) { + echo "The 'first' element is in the array"; +} + + + + + See also isset. + + + + krsort