ninja_forms_remove_from_array

The Ninja Forms ninja forms remove from array function.

Description

ninja_forms_remove_from_array( $arr, $key, $val, (constant) $within = FALSE ); 

Parameters (4)

0. $arr
The arr.
1. $key
The key.
2. $val
The val.
3. $within — Optional. (constant) => FALSE
The within.

Usage

  1. if ( !function_exists( 'ninja_forms_remove_from_array' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/functions.php'; 
  3.  
  4. // The arr. 
  5. $arr = null; 
  6.  
  7. // The key. 
  8. $key = null; 
  9.  
  10. // The val. 
  11. $val = null; 
  12.  
  13. // The within. 
  14. $within = FALSE; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = ninja_forms_remove_from_array($arr, $key, $val, $within); 
  18.  

Defined (1)

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

/deprecated/includes/functions.php  
  1. function ninja_forms_remove_from_array($arr, $key, $val, $within = FALSE) { 
  2. foreach ($arr as $i => $array) 
  3. if ($within && stripos($array[$key], $val) !== FALSE && (gettype($val) === gettype($array[$key]))) 
  4. unset($arr[$i]); 
  5. elseif ($array[$key] === $val) 
  6. unset($arr[$i]); 
  7.  
  8. return array_values($arr);