Changeset 2247 for trunk/wp-includes/functions-compat.php
- Timestamp:
- 02/11/2005 12:57:46 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-compat.php
r1776 r2247 48 48 } 49 49 50 if (!defined('CASE_LOWER')) { 51 define('CASE_LOWER', 0); 52 } 53 54 if (!defined('CASE_UPPER')) { 55 define('CASE_UPPER', 1); 56 } 57 58 59 /** 60 * Replace array_change_key_case() 61 * 62 * @category PHP 63 * @package PHP_Compat 64 * @link http://php.net/function.array_change_key_case 65 * @author Stephan Schmidt <schst@php.net> 66 * @author Aidan Lister <aidan@php.net> 67 * @version $Revision$ 68 * @since PHP 4.2.0 69 * @require PHP 4.0.0 (user_error) 70 */ 71 if (!function_exists('array_change_key_case')) { 72 function array_change_key_case($input, $case = CASE_LOWER) 73 { 74 if (!is_array($input)) { 75 user_error('array_change_key_case(): The argument should be an array', 76 E_USER_WARNING); 77 return false; 78 } 79 80 $output = array (); 81 $keys = array_keys($input); 82 $casefunc = ($case == CASE_LOWER) ? 'strtolower' : 'strtoupper'; 83 84 foreach ($keys as $key) { 85 $output[$casefunc($key)] = $input[$key]; 86 } 87 88 return $output; 89 } 90 } 91 50 92 ?>
Note: See TracChangeset
for help on using the changeset viewer.