note 88648 added to function.array-change-key-case

From: Date: Mon, 02 Feb 2009 11:22:26 +0000
Subject: note 88648 added to function.array-change-key-case
Groups: php.notes 
Request: Send a blank email to php-notes+get-150092@lists.php.net to get a copy of this message
Same as array_change_key_case only with the values. This should really be part of PHP! /** * @brief Returns an array with all values lowercased or uppercased. * @return array Returns an array with all values lowercased or uppercased. * @param object $input The array to work on * @param int $case [optional] Either \c CASE_UPPER or \c CASE_LOWER (default). */ function array_change_value_case(array $input, $case = CASE_LOWER) { switch ($case) { case CASE_LOWER: return array_map('strtolower', $input); break; case CASE_UPPER: return array_map('strtoupper', $input); break; default: trigger_error('Case is not valid, CASE_LOWER or CASE_UPPER only', E_USER_ERROR); return false; } } ---- Server IP: 208.69.120.35 Probable Submitter: 208.53.106.220 ---- Manual Page -- http://www.php.net/manual/en/function.array-change-key-case.php Edit -- https://master.php.net/note/edit/88648 Del: integrated -- https://master.php.net/note/delete/88648/integrated Del: useless -- https://master.php.net/note/delete/88648/useless Del: bad code -- https://master.php.net/note/delete/88648/bad+code Del: spam -- https://master.php.net/note/delete/88648/spam Del: non-english -- https://master.php.net/note/delete/88648/non-english Del: in docs -- https://master.php.net/note/delete/88648/in+docs Del: other reasons-- https://master.php.net/note/delete/88648 Reject -- https://master.php.net/note/reject/88648 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#150092) next »