How to deal with ajax?

Source: Internet
Author: User
The ajax process is as follows: first, the foreground php page is passed to the js file, the js file uploads the value to the background processing page, and then four arrays are returned to the js page. Now I want to pass these four arrays to the front-end php page. I don't know how to do this. I want to give a thought or related information. thank you. serialize the array and then upload it, PHPcode $ arr = array (1, 2, 3, 4) about ajax
The process is as follows: first, the front-end php page is passed to the js file, the js file transfers the value to the background processing page, and then four arrays are returned to the js page. Now I want to pass these four arrays to the php page at the front end. I don't know how to do this. I 'd like to give you some ideas or related materials. thank you.

------ Solution --------------------
Serialize the array and then upload it,
PHP code
$ Arr = array (1, 2, 4); $ nrr = serialize ($ arr );
------ Solution --------------------
Dizzy, what is this complicated? since the final result is php-> php, use session to register your four arrays and use them directly at the front-end!
------ Solution --------------------
Discussion
Reference:
Serialize the array and upload it again. PHP code $ arr = array (1, 2, 3, 4); $ nrr = serialize ($ arr );
Receiving page
PHP code $ arr = unserialize ($ nrr );

How can I transmit the js array to the front-end page of php?

------ Solution --------------------
Assign the value to be passed to a data value on the server, and then output the value after json_encode ().
Then, after Js is obtained, it can be directly called.

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.