Annotation of /mambo/branches/4.6/includes/compat.php41x.php
Parent Directory
|
Revision Log
Revision 1756 - (view) (download)
| 1 : | elpie | 964 | <?php |
| 2 : | /** | ||
| 3 : | * @package Mambo | ||
| 4 : | * @author Mambo Foundation Inc see README.php | ||
| 5 : | elpie | 1756 | * @author Mambo Foundation Inc see README.php |
| 6 : | * @copyright (C) 2000 - 2009 Mambo Foundation Inc. | ||
| 7 : | * See COPYRIGHT.php for copyright notices and details. | ||
| 8 : | * @license GNU/GPL Version 2, see LICENSE.php | ||
| 9 : | * | ||
| 10 : | * Redistributions of files must retain the above copyright notice. | ||
| 11 : | * | ||
| 12 : | * Mambo is free software; you can redistribute it and/or | ||
| 13 : | * modify it under the terms of the GNU General Public License | ||
| 14 : | * as published by the Free Software Foundation; version 2 of the License. | ||
| 15 : | */ | ||
| 16 : | elpie | 964 | |
| 17 : | /** ensure this file is being included by a parent file */ | ||
| 18 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 19 : | |||
| 20 : | if (!function_exists( 'array_change_key_case' )) { | ||
| 21 : | if (!defined('CASE_LOWER')) { | ||
| 22 : | define('CASE_LOWER', 0); | ||
| 23 : | } | ||
| 24 : | if (!defined('CASE_UPPER')) { | ||
| 25 : | define('CASE_UPPER', 1); | ||
| 26 : | } | ||
| 27 : | function array_change_key_case( $input, $case=CASE_LOWER ) { | ||
| 28 : | if (!is_array( $input )) { | ||
| 29 : | return false; | ||
| 30 : | } | ||
| 31 : | $array = array(); | ||
| 32 : | foreach ($input as $k=>$v) { | ||
| 33 : | if ($case) { | ||
| 34 : | $array[strtoupper( $k )] = $v; | ||
| 35 : | } else { | ||
| 36 : | $array[strtolower( $k )] = $v; | ||
| 37 : | } | ||
| 38 : | } | ||
| 39 : | return $array; | ||
| 40 : | } | ||
| 41 : | } | ||
| 42 : | root | 1 | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

