Questions about recursive array handling

Source: Internet
Author: User
Since PHP is no longer supported for MAGIC_QUOTES_GPC functions over PHP5.4.3, I want to directly
if (php_version >= 5.4 | |!GET_MAGIC_QUOTES_GPC ())
{
$_request = Array_map (' addslashes ', $_request);
$_post = Array_map (' addslashes ', $_post);
$_get = Array_map (' addslashes ', $_get);
}
To resolve the ', ' problem in the user submission data, but found that the ARRAY_MAP function cannot resolve the problem of recursion if the control name is more than one of the same names, similar to ck[], and
Using Array_walk_recursive, and back to the hint fatal error:call-time pass-by-reference has been removed, please PHP5.4.3 the above version can have a function to solve this problem


Reply to discussion (solution)

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

can refer to the following

Array_walk_recursive ($_post, function (& $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.