recurse_array_change_key_case()递规返回字符串键名全为小写或大写的数组
//递归返回字符串键名全为小写或大写的数组
function recurse_array_change_key_case(&$input, $case = CASE_LOWER){
if(!is_array($input))
return;
foreach($input as $key => $val)
{
//1
if($case == CASE_UPPER)
{
$newkey = strtoupper($key);
}
//0
elseif($case == CASE_LOWER)
{
$newkey = strtolower($key);
}
if($newkey != $key)
{
unset($input[$key]);
$input[$newkey] = $val;
}
if(is_array($val))
{
//###注:此处的参数须为$input[$newkey],而不是$val,如果是$val,需要在foreach中 $key=>&$val
recurse_array_change_key_case($input[$newkey], $case);
}
}
}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 Chinese version
Chinese version, very easy to use
