wordpress / latest / functions / wp_recursive_ksort.html

wp_recursive_ksort( array $array )

Sorts the keys of an array alphabetically.

Description

The array is passed by reference so it doesn’t get returned which mimics the behaviour of ksort.

Parameters

$array array Required
The array to sort, passed by reference.

Source

File: wp-includes/functions.php. View all references

function wp_recursive_ksort( &$array ) {
	foreach ( $array as &$value ) {
		if ( is_array( $value ) ) {
			wp_recursive_ksort( $value );
		}
	}
	ksort( $array );
}

Uses

Uses Description

Used By

Used By Description

Changelog

Version Description
6.0.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_recursive_ksort