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.


Top ↑

Parameters

$array

(array) (Required) The array to sort, passed by reference.


Top ↑

Source

File: wp-includes/functions.php

function wp_recursive_ksort( &$array ) {
	foreach ( $array as &$value ) {
		if ( is_array( $value ) ) {
			wp_recursive_ksort( $value );
		}
	}
	ksort( $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.