add_magic_quotes

Walks the array while sanitizing the contents.

Description

(array) add_magic_quotes( (array) $array ); 

Returns (array)

Sanitized $array.

Parameters (1)

0. $array (array)
Array to walk while sanitizing contents.

Usage

  1. if ( !function_exists( 'add_magic_quotes' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.php'; 
  3.  
  4. // Array to walk while sanitizing contents. 
  5. $array = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = add_magic_quotes($array); 
  9.  

Defined (1)

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

/wp-includes/functions.php  
  1. function add_magic_quotes( $array ) { 
  2. foreach ( (array) $array as $k => $v ) { 
  3. if ( is_array( $v ) ) { 
  4. $array[$k] = add_magic_quotes( $v ); 
  5. } else { 
  6. $array[$k] = addslashes( $v ); 
  7. return $array;