PHP callback function writing solution

Source: Internet
Author: User
In PHP, the callback function is written to solve the callback JQuery & nbsp; $. post function in PHP. I will know if one parameter is passed, but how to write multiple parameters? For example: $. post ("/home/getcode", function (cl7, cl8) {var & nbsp; cl9 = cl7.SecCode; var & n PHP callback function writing solution
In PHP, I can call back the functions in JQuery $. post and pass one parameter. but how can I write multiple parameters?
For example: $. post ("/home/getcode", function (cl7, cl8) {var cl9 = cl7.SecCode; var linoleic = cl7.KCode; var clb = camelcrypto (cl9, linoleic); $. post ("/home/vote", {id: cl6, selOpts: cl4, questName: cl5, chkCode: $ ("# chkcode "). val (), secCode: clb, num1: Math. random ()}, function (clc, cld) {$ ("# btn_vote "). show (); var cle = clc. RCode; $ ("# vote_tips "). text (""); if (cle =-1000) {$ ("# chkCodeMsg "). text (clc. msg); $ ("# chkCodeDialog "). dialog ("open"); $ ("# chkCodeDialog "). click ()} else {alert (clc. msg); if (clc. success) {document. location = document. location }})})}; cl2.preventDefault ()}); $ ("# btn_votecode "). click (function () {$ ("# btn_vote "). click ()}; function showVoteBar () {$ (". vcount "). show (); $ (". votebar: hidden "). each (function (cl0) {var cl1 = $ (this ). val (); $ (this ). parent (). animate ({"width": cl1 + "px"}, 1000 )})}
How to return a call in PHP
------ Solution --------------------
Function (cl7, cl8)
Change
Function (d ){
C17 = d. c17;
C18 = d. c18;

Php:
Echo json_encode (array ('c17' => 123, 'C1' => 456 ));

Jq cannot predict how you use it, so it uses a unified format for processing.
The so-called: should be retained

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.