<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * 二手房后台系统共用函数文件
 *
 * @package     CodeIgniter
 * @subpackage  Helpers
 * @category    Helpers
 * @author      HOUSE365 ESF Dev Team
 * @link        http://nj.sell.house365.com/
 */

/**
 * 转换数组的key值大小写
 * @param   array   $arr_source 需要转换的数组
 * @param   boolean $case   0代表需要转化成小写/1需要转化成大写
 * @return  array   转换后的数组
 * @update  2014/5/30 esf dev team
 */
if(!function_exists('array_key_to_case'))
{
    function array_key_to_case( $arr_source , $case = 0 )
    {
        $arr_destination = array();

        foreach ( $arr_source as $key => $item )
        {
            if ( $case )
            {
                $keyTemp = strtoupper($key);
            }
            else
            {
                $keyTemp = strtolower($key);
            }

            $arr_destination[$keyTemp] = $item;

            if ( is_array($item) )
            {
                $arr_destination[$keyTemp] = array_key_to_case($item, $case);
            }
        }

        return $arr_destination;
    }
}

/* End of file common_array_helper.php */
/* Location: ./applications/helpers/common_array_helper.php */