/*** 引用递归数组首字母转小写(兼容此系统的代码命名规范)** @param $array* @return array*/protected function lowerArrayFirstWord(&$array){if (!is_array($array)) {return $array;}foreach ($array as $key => $value) {$str = trim($key);$first = $str[0]; //获取第一个字符//只处理大写字母if (preg_match('/^[A-Z]+$/', $first)) {$array[lcfirst($key)] = $this->lowerArrayFirstWord($value);unset($array[$key]);}}return $array;}$data = ['Data' => '123','Body' => ['Text' => '12334','Msg' => 'Databases','Add' => ['a' => 1,'B' => 2,'3' => 3,],],];$res = $this->lowerArrayFirstWord($data);var_dump($res);exit;