gtm4wp_is_assoc

The Google Tag Manager for WordPress gtm4wp is assoc function.

Description

gtm4wp_is_assoc( $arr ); 

Parameters (1)

0. $arr
The arr.

Usage

  1. if ( !function_exists( 'gtm4wp_is_assoc' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-tag-manager-for-wordpress/public/frontend.php'; 
  3.  
  4. // The arr. 
  5. $arr = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gtm4wp_is_assoc($arr); 
  9.  

Defined (1)

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

/public/frontend.php  
  1. function gtm4wp_is_assoc($arr) { 
  2. // borrowed from 
  3. // http://stackoverflow.com/questions/173400/php-arrays-a-good-way-to-check-if-an-array-is-associative-or-sequential 
  4. return array_keys($arr) !== range(0, count($arr) - 1);