wp_kses_array_lc() WordPress Function

The wp_kses_array_lc() function is used to lowercase the contents of an array. This is useful for ensuring that case-sensitive data is handled consistently.

wp_kses_array_lc( array $inarray ) #

Converts the keys of an array to lowercase.


Parameters

$inarray

(array)(Required)Unfiltered array.


Top ↑

Return

(array) Fixed array with all lowercase keys.


Top ↑

Source

File: wp-includes/kses.php

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;
}

Top ↑

Changelog

Changelog
VersionDescription
1.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.