wp_recursive_ksort( array $input_array )

Sorts the keys of an array alphabetically.


Description

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


Top ↑

Parameters

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

Top ↑

Source

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

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

	ksort( $input_array );
}


Top ↑

Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes

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