Recursive array processing

Source: Internet
Author: User
For more information about recursive array processing, PHP does not support magic_quotes_gpc because PHP5.4.3 or above.
If (PHP_VERSION> = 5.4 |! Get_magic_quotes_gpc ())
{
$ _ REQUEST = array_map ('addslashes ', $ _ REQUEST );
$ _ POST = array_map ('addslashes ', $ _ POST );
$ _ GET = array_map ('addslashes ', $ _ GET );
}
But the array_map function cannot solve the recursion problem. if the control name is multiple with the same name, it is similar to ck [], and
Array_polic_recursive is used, and Fatal error: Call-time pass-by-reference has been removed is returned. may I ask PHP5.4.3 or a later version to solve this problem?


Reply to discussion (solution)

Http://bbs.csdn.net/topics/390936241

Refer

Array_walk_recursive ($ _ POST, function (& $ v) {v v = addslashes ($ v );});
Other similar

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.