wp_is_numeric_array

Determines if the variable is a numeric-indexed array.

Description

wp_is_numeric_array( (mixed) $data ); 

Parameters (1)

0. $data (mixed)
Variable to check.

Usage

  1. if ( !function_exists( 'wp_is_numeric_array' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.php'; 
  3.  
  4. // Variable to check. 
  5. $data = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_is_numeric_array($data); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/functions.php  
  1. function wp_is_numeric_array( $data ) { 
  2. if ( ! is_array( $data ) ) { 
  3. return false; 
  4.  
  5. $keys = array_keys( $data ); 
  6. $string_keys = array_filter( $keys, 'is_string' ); 
  7. return count( $string_keys ) === 0;