_usort_by_first_member

Sorts a multidimensional array by first member of each top level member.

Description

(int) _usort_by_first_member( (array) $a, (array) $b ); 

Used by uasort() as a callback, should not be used directly.

Returns (int)

Parameters (2)

0. $a (array)
The a.
1. $b (array)
The b.

Usage

  1. if ( !function_exists( '_usort_by_first_member' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/import.php'; 
  3.  
  4. // The a. 
  5. $a = array(); 
  6.  
  7. // The b. 
  8. $b = array(); 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = _usort_by_first_member($a, $b); 
  12.  

Defined (1)

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

/wp-admin/includes/import.php  
  1. function _usort_by_first_member( $a, $b ) { 
  2. return strnatcasecmp( $a[0], $b[0] );