How does php parse the data Post submitted by jqueryserialize? Finally, the Jasmine_xiaocao client is edited from 2013-05-1418: 33: 40 through jquery & nbsp; serialize & nbsp; submit form data $ (# submit_survey ). click (function () {& nbsp; & nb php how to parse the data submitted by jquery serialize
This post was last edited by Jasmine_xiaocao at 18:33:40
The client submits form data through 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 ('saved successfully', $ ('. submit_tips'), 'right ');
}
}, 'Json ');
Return false;
});
The data post to the php end 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 it 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: