PHP addslashes Recursive implementation of backslash reference string method

Source: Internet
Author: User
This article describes a recursive implementation of PHP using a backslash to reference strings, through an example, to help you understand.

PHP addslashes recursive backslash reference string, the code is as follows:

    
     ' "; $_get[' STR1 '] = ' Fanglor" is \ a  boy  > '; Echo ' current GET_MAGIC_QUOTES_GPC is  '. GET_MAGIC_QUOTES_GPC (); echo "
";//Determine whether Get_magic_quotes_gpc//by bbs.it-home.orgif (!GET_MAGIC_QUOTES_GPC ()) {$_post = Addslashes_deep ($_POST) is currently turned on; $_get = Addslashes_deep ($_get); $_cookie = Addslashes_deep ($_cookie);} Print result Var_dump ($_post); echo "
"; Var_dump ($_get);? >

Printing results:

The current GET_MAGIC_QUOTES_GPC is 0array (1) {["STR"]=> string "\ ' Fanglor \ ' was \ \ A boy >\ '"}array (1) {["STR1"]=> St Ring (+) "Fanglor \" is \ \ a boy > "}
  • 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.