PHP How to parse jquery Serialize data after submission

Source: Internet
Author: User
How PHP resolves data submitted by jquery serialize
This post was last edited by Jasmine_xiaocao on 2013-05-14 18:33:40

Client submits form data via jquery serialize


$ ("#submit_survey"). Click (function () {
$.post (site_url+ ' Activity/survey/savesurvey ', {data:$ (' #survey_form '). Serialize ()}, function (response) {
if (Response.error_code) {
Infotips (response.msg, $ ('. Submit_tips '));
} else {
Infotips (' Save succeeded ', $ ('. Submit_tips '), ' right ');


return false;
});


The data to post to on the PHP side is:
title=%e6%82%a8%e5%8f%af%e4%bb%a5%e5%9c%a8%e8%bf%99%e9%87%8c%e5%88%9b%e5%bb%ba%e6%82%a8%e7%9a%84%e9%97%ae%e7% Ad%94%e9%a2%98%e7%9b%ae%ef%bc%8c%e5%90%8c%e6%97%b6%e5%af%b9%e9%97%ae%e7%ad%94%e6%b4%bb%e5%8a%a8%e5%8a%a0%e4%bb %a5%e8%af%b4%e6%98%8e&cover_image=&file_name=&file_partpath=&description=&isgender=0& isarea=0&isage=0&question%5b1%5d=ghk&option%5b1%5d%5b0%5d=hgkhk&option%5b1%5d%5b1%5d=hkhj& Option%5b1%5d%5b2%5d=khgkhk&option%5b1%5d%5b3%5d=&question%5b2%5d=hgkh&option%5b2%5d%5b0%5d=hkhjk &option%5b2%5d%5b1%5d=hjkhjl&option%5b2%5d%5b2%5d=

How to replace with the correct format:
Array
(
[Title] = DSGD
[Cover_image] = HDSGDSG
[file_name] = 219_20130514170542.jpg
[File_partpath] =
[Description] =
[Isgender] = 0
[Isarea] = 0
[Isage] = 0
[question] = = Array
(
[1] = DGDG
)

[option] = = Array
(
[1] = = Array
(
[0] = = AA
[1] = BB
[2] + = CC
)

)

)


Share to:
  • 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.