WordPress开发者和主题制作者的搜索引擎



add_magic_quotes ›

Since0.71
已弃用n/a
add_magic_quotes ( $array )
参数:
  • (array) $array Array to walk while sanitizing contents.
    Required: Yes
返回:
  • (array) Sanitized $array.
定义在:
文档:

Walks the array while sanitizing the contents.



源码

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;
}