W3cubDocs

/WordPress

wp_is_numeric_array( mixed $data )

Determines if the variable is a numeric-indexed array.

Description

Parameters

$data

(mixed) (Required) Variable to check.

Return

(bool) Whether the variable is a list.

Source

File: wp-includes/functions.php

function wp_is_numeric_array( $data ) {
	if ( ! is_array( $data ) ) {
		return false;
	}

	$keys        = array_keys( $data );
	$string_keys = array_filter( $keys, 'is_string' );
	return count( $string_keys ) === 0;
}

Changelog

Version Description
4.4.0 Introduced.

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