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

From: Date: Wed, 30 Jan 2008 17:22:21 +0000
Subject: note 80753 added to function.array-change-key-case
Groups: php.notes 
Request: Send a blank email to php-notes+get-135622@lists.php.net to get a copy of this message
Basically this is the function if your version is lower than 4.2.0 <?php if ( !defined('CASE_LOWER') )define('CASE_LOWER', 0); if ( !defined('CASE_UPPER') )define('CASE_UPPER', 1); if(!function_exists("array_change_key_case")){ function array_change_key_case($input, $case=0){ if(!is_array($input))return FALSE; $product = array(); foreach($input as $key => $value){ if($case){ //Upper $key2 = ( (is_string($key)) ? (strtoupper($key)) : ($key) ); $product[$key2] = $value; } else{ //Lower $key2 = ( (is_string($key)) ? (strtolower($key)) : ($key) ); $product[$key2] = $value; } } return $product; }/* endfunction array_change_key_case */ }/* endfunction exists array_change_key_case*/ ?> ---- Server IP: 69.147.83.197 Probable Submitter: 87.120.68.77 ---- Manual Page -- http://www.php.net/manual/en/function.array-change-key-case.php Edit -- https://master.php.net/note/edit/80753 Del: integrated -- https://master.php.net/note/delete/80753/integrated Del: useless -- https://master.php.net/note/delete/80753/useless Del: bad code -- https://master.php.net/note/delete/80753/bad+code Del: spam -- https://master.php.net/note/delete/80753/spam Del: non-english -- https://master.php.net/note/delete/80753/non-english Del: in docs -- https://master.php.net/note/delete/80753/in+docs Del: other reasons-- https://master.php.net/note/delete/80753 Reject -- https://master.php.net/note/reject/80753 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135622) next »