Php processes the form content _ PHP Tutorial

Source: Internet
Author: User
Php processes the form content. Php returns the ** @ param $ string * @ parambool $ HTML ** @ returnarray | string * publicstaticfunctionsafeOutput ($ string, $ html php processes the form content
/*** After filtering HTML content, return ** @ param $ string * @ param bool $ html ** @ return array | string */public static function safeOutput ($ string, $ html = false) {if (! $ Html) $ string = strip_tags ($ string); return @ Tools: htmlentitiesUTF8 ($ string, ENT_QUOTES);} public static function htmlentitiesUTF8 ($ string, $ type = ENT_QUOTES) {if (is_array ($ string) return array_map (array ('tool', 'htmlentitiesutf8'), $ string); return htmlentities (string) $ string, $ type, 'utf-8');} public static function htmlentitiesDecodeUTF8 ($ string) {if (is_array ($ string) return array_map (array ('t Ools ', 'htmlentitiesdecodeutf8'), $ string); return html_entity_decode (string) $ string, ENT_QUOTES, 'utf-8 ');} /*** process POST content ** @ return array */public static function safePostVars () {if (! Is_array ($ _ POST) return array (); $ _ POST = array_map (array ('tool', 'htmlentitiesutf8'), $ _ POST );}

Returns ** @ param $ string * @ param bool $ HTML ** @ return array | string */public static function safeOutput ($ string, $ html =...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.