NXS_doSetArrRecursive

The NextScripts: Social Networks Auto-Poster NXS doSetArrRecursive function.

Description

NXS_doSetArrRecursive( &$array, $path, $value ); 

Parameters (3)

0. $array
The array.
1. $path
The path.
2. $value
The value.

Usage

  1. if ( !function_exists( 'NXS_doSetArrRecursive' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextscripts-social-networks-auto-poster/nxs_functions.php'; 
  3.  
  4. // The array. 
  5. $array = &$array; 
  6.  
  7. // The path. 
  8. $path = null; 
  9.  
  10. // The value. 
  11. $value = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = NXS_doSetArrRecursive($array, $path, $value); 
  15.  

Defined (1)

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

/nxs_functions.php  
  1. if (!function_exists("NXS_doSetArrRecursive")) { function NXS_doSetArrRecursive(&$array, $path, $value) { $key = array_shift($path); //prr($path); prr($key); echo "|-"; prr($array); echo "-|"; 
  2. if (empty($path)) if (trim($key)=='') $array[] = $value; else $array[$key] = $value; else { if (!isset($array[$key]) || !is_array($array[$key])) $array[$key] = array(); NXS_doSetArrRecursive($array[$key], $path, $value); } 
  3. }}