WordPress at Your Fingertips
function is not described


RestApiUtil::is_associative() private WC 1.0

Is an array sequential or associative?

{} It's a method of the class: RestApiUtil{}

No Hooks.


true|false. True if the array is associative, false if it's sequential.


$result = RestApiUtil::is_associative( $array );
$array(array) (required)
The array to check.

Code of RestApiUtil::is_associative() WC 5.9.0

private static function is_associative( array $array ) {
	return array_keys( $array ) !== range( 0, count( $array ) - 1 );