ninja_forms_str_replace_deep

The Ninja Forms ninja forms str replace deep function.

Description

ninja_forms_str_replace_deep( $search, $replace, $subject ); 

Parameters (3)

0. $search
The search.
1. $replace
The replace.
2. $subject
The subject.

Usage

  1. if ( !function_exists( 'ninja_forms_str_replace_deep' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/database.php'; 
  3.  
  4. // The search. 
  5. $search = null; 
  6.  
  7. // The replace. 
  8. $replace = null; 
  9.  
  10. // The subject. 
  11. $subject = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = ninja_forms_str_replace_deep($search, $replace, $subject); 
  15.  

Defined (1)

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

/deprecated/includes/database.php  
  1. function ninja_forms_str_replace_deep($search, $replace, $subject) { 
  2. if( is_array( $subject ) ) { 
  3. foreach( $subject as &$oneSubject ) 
  4. $oneSubject = ninja_forms_str_replace_deep($search, $replace, $oneSubject); 
  5. unset($oneSubject); 
  6. return $subject; 
  7. } else { 
  8. return str_replace($search, $replace, $subject);