addslashes_gpc

Adds slashes to escape strings.

Description

(string) addslashes_gpc( (string) $gpc ); 

Slashes will first be removed if magic_quotes_gpc is set, see for more details.

Returns (string)

Returns a string escaped with slashes.

Parameters (1)

0. $gpc (string)
The string returned from HTTP request data.

Usage

  1. if ( !function_exists( 'addslashes_gpc' ) ) { 
  2. require_once ABSPATH . WPINC . '/formatting.php'; 
  3.  
  4. // The string returned from HTTP request data. 
  5. $gpc = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = addslashes_gpc($gpc); 
  9.  

Defined (1)

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

/wp-includes/formatting.php  
  1. function addslashes_gpc($gpc) { 
  2. if ( get_magic_quotes_gpc() ) 
  3. $gpc = stripslashes($gpc); 
  4.  
  5. return wp_slash($gpc);