wp_kses_array_lc( array $inarray ): array

In this article

Converts the keys of an array to lowercase.

Parameters

$inarrayarrayrequired
Unfiltered array.

Return

array Fixed array with all lowercase keys.

Source

function wp_kses_array_lc( $inarray ) {
	$outarray = array();

	foreach ( (array) $inarray as $inkey => $inval ) {
		$outkey              = strtolower( $inkey );
		$outarray[ $outkey ] = array();

		foreach ( (array) $inval as $inkey2 => $inval2 ) {
			$outkey2                         = strtolower( $inkey2 );
			$outarray[ $outkey ][ $outkey2 ] = $inval2;
		}
	}

	return $outarray;
}

Changelog

VersionDescription
1.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.