add_magic_quotes()
add_magic_quotes( array $array )
在清理内容时遍历数组。
Walks the array while sanitizing the contents.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$array | (array) | 必需 | 清理内容时要行走的数组。 |
返回(Return)
(array)清理了$array。
源码(Source)
/** * Walks the array while sanitizing the contents. * * @since 0.71 * * @param array $array Array to walk while sanitizing contents. * @return array Sanitized $array. */ function add_magic_quotes( $array ) { foreach ( (array) $array as $k => $v ) { if ( is_array( $v ) ) { $array[$k] = add_magic_quotes( $v ); } else { $array[$k] = addslashes( $v ); } } return $array; }
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
0.71 | wp-includes/functions.php:1220 | 4 | 1 function |
add_magic_quotes() 为WP2原创文章,链接:https://www.wp2.cn/functions/add_magic_quotes/