wp_is_numeric_array( mixed $data )

Determines if the variable is a numeric-indexed array.


Description Description


Parameters Parameters

$data

(mixed) (Required) Variable to check.


Top ↑

Return Return

(bool) Whether the variable is a list.


Top ↑

Source 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;
}

Top ↑

Changelog Changelog

Changelog
Version Description
4.4.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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