WordPress at a glance

wp_is_numeric_array() WP 1.0

Determines if the variable is a numeric-indexed array.

✈ 1 time = 0.000016s = very fast | 50000 times = 0.03s = speed of light PHP 7.0.4, WP 4.4.2

No Hooks.

Return

true/false. Whether the variable is a list.

Usage

wp_is_numeric_array( $data );
$data(mixed) (required)
Variable to check.

Code of wp_is_numeric_array: wp-includes/functions.php VER 4.9.8

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

Related Functions

From tag: array list help functions (sorting arrays objects)

More from category: Helper Functions

No comments
    Hello, !     Log In . Register