wpcf7_array_flatten

The Contact Form 7 wpcf7 array flatten function.

Description

wpcf7_array_flatten( $input ); 

Parameters (1)

0. $input
The input.

Usage

  1. if ( !function_exists( 'wpcf7_array_flatten' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/includes/functions.php'; 
  3.  
  4. // The input. 
  5. $input = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wpcf7_array_flatten($input); 
  9.  

Defined (1)

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

/includes/functions.php  
  1. function wpcf7_array_flatten( $input ) { 
  2. if ( ! is_array( $input ) ) { 
  3. return array( $input ); 
  4.  
  5. $output = array(); 
  6.  
  7. foreach ( $input as $value ) { 
  8. $output = array_merge( $output, wpcf7_array_flatten( $value ) ); 
  9.  
  10. return $output;