PHP头条
热点:

wordpress3.6才引入的处理输入转义字符的-PHP源码


php代码

/**
 * Add slashes to a string or array of strings.
 *
 * This should be used when preparing data for core API that expects slashed data.
 * This should not be used to escape data going directly into an SQL query.
 *
 * @since 3.6.0
 *
 * @param string|array $value String or array of strings to slash.
 * @return string|array Slashed $value
 */
function wp_slash( $value ) {
        if ( is_array( $value ) ) {
                foreach ( $value as $k => $v ) {
                        if ( is_array( $v ) ) {
                                $value[$k] = wp_slash( $v );
                        } else {
                                $value[$k] = addslashes( $v );
                        }
                }
        } else {
                $value = addslashes( $value );
        }

        return $value;
}

www.phpzy.comtrue/php/39825.htmlTechArticlewordpress3.6才引入的处理输入转义字符的-PHP源码 php代码 /** * Add slashes to a string or array of strings. * * This should be used when preparing data for core API that expects slashed data. * This should not be used to esca...

相关文章

PHP之友评论

今天推荐