addslashes_gpc()

addslashes_gpc()函数是Wordpress函数,添加斜线以转义字符串。

addslashes_gpc( string $gpc )

添加斜线以转义字符串。
Adds slashes to escape strings.

说明(Description)

如果设置了magic_quotes_gpc,将首先删除斜线,请参见https://www.php.net/magic_quotes更多细节。


参数(Parameters)

参数类型必填说明
$gpc(string)必需从HTTP请求数据返回的字符串。

返回(Return)

(string)返回用斜杠转义的string。


源码(Source)

/**
 * Adds slashes to escape strings.
 *
 * Slashes will first be removed if magic_quotes_gpc is set, see {@link
 * http://www.php.net/magic_quotes} for more details.
 *
 * @since 0.71
 *
 * @param string $gpc The string returned from HTTP request data.
 * @return string Returns a string escaped with slashes.
 */
function addslashes_gpc($gpc) {
	if ( get_magic_quotes_gpc() )
		$gpc = stripslashes($gpc);
	return wp_slash($gpc);
}
更新版本源码位置使用被使用
0.71wp-includes/formatting.php:27191 function1 function
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索