ninja_forms_subval_sort
The Ninja Forms ninja forms subval sort function.
Description
Parameters (2)
- 0. $a
- The a.
- 1. $subkey
- The subkey.
Usage
if ( !function_exists( 'ninja_forms_subval_sort' ) ) { require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/functions.php'; } // The a. $a = null; // The subkey. $subkey = null; // NOTICE! Understand what this does before running. $result = ninja_forms_subval_sort($a, $subkey);
Defined (1)
The function is defined in the following location(s).
- /deprecated/includes/functions.php
- function ninja_forms_subval_sort( $a, $subkey ) {
- $b = '';
- foreach($a as $k=>$v) {
- $b[$k] = strtolower($v[$subkey]);
- }
- if ( is_array ( $b ) ) {
- asort($b);
- foreach($b as $key=>$val) {
- $c[] = $a[$key];
- }
- return $c;
- } else {
- return $a;
- }
- }