PARSE_STR parsing serialize generated string error with multiple selection form

Source: Internet
Author: User
Tags array to string

Parse_str parse serialize generated string, because the form has multiple selection of forms, parsing when the value of the multi-select form into a two-dimensional array, parsed into an array of this character, how to do?

The image is the Parse_str parsed array
The error of the report is: Array to string conversion

Reply content:

Parse_str parse serialize generated string, because the form has multiple selection of forms, parsing when the value of the multi-select form into a two-dimensional array, parsed into an array of this character, how to do?

The image is the Parse_str parsed array
The error of the report is: Array to string conversion

This is because the checked query string format is inconsistent, and the RFC standard does not specify what format the query string should be, so the various languages have their own format for one-key multivalued, such as jquery (or JS series): rzqd=网络搜索&rzqd=自己 or rzqd=网络搜索,自己, but the format of PHP is rzqd[]=网络搜索&rzqd[]=自己 . I think you either directly on the form, or you write a function to parse it, it is not complicated anyway.

  • 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.