How to use arrays to accept this series of parameters

Source: Internet
Author: User
How to use arrays to accept this series of parameters? Use jquery to asynchronously pass a series of parameters to page B: & nbsp; $. get ('Get. php? A = & quot; + Math. random () ', {name: $ (this ). val ()}, function (data) {& nbsp; how to use arrays to accept this series of parameters?
Use jquery to asynchronously pass a series of parameters to page B:
$. Get ('Get. php? A = "+ Math. random () ', {name: $ (this). val ()}, function (data ){
Alert (unescape (data ));
});
$ (This ). val () is a group of data whose values are 1, 2, 4, and $. the get method transmits this set of data to page B. on page B, how can we use arrays to receive this set of data and display it with array indexes? for example, echo $ name [1] can print 2.

------ Solution --------------------
$ _ GET ['name'] = '1, 2, 3, 4 ';

$ Arr = explode (',', $ _ GET ['name']);
Print_r ($ arr );

// Output result
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
)

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.