### 描述

添加斜杠以转义字符串。

如果设置了magic\_quotes\_gpc，将首先删除斜杠。

### 用法

 ```
addslashes_gpc( <em>string</em> $gpc )
```

### 参数

**$gpc**

*(string)* (必需) 从HTTP请求数据返回的字符串。

### 返回

(*string*)返回使用斜杠转义的字符串。

### 来源

文件：wp-includes/formatting.php

 ```
function addslashes_gpc( $gpc ) {<br></br>    if ( get_magic_quotes_gpc() ) {<br></br>        $gpc = stripslashes( $gpc );<br></br>    }<br></br>    return wp_slash( $gpc );<br></br>}
```