Php,js, dealing with array problems
Younger brother Beginner, some do not understand, I use AJAX processing PHP after returning such an array
Array
(
[0]=>array
(
[0]=>2
[Id]=>2
[1]=> Zhang San
[name]=> Zhang San
)
[1]=>array
(
[0]=>3
[Id]=>3
[1]=> John Doe
[name]=> John Doe
)
)
The value returned by Ajax is not the value of the array with JS, value[0][0] So take the wrong? What's the value of a?
------Solution--------------------
It is recommended to search for an instance of PHP Ajax that returns JSON data.
------Solution--------------------
Put your returned array, with the Json_encode () function, and then return to the front end JS use, should not be wrong
------Solution--------------------
It is best to convert to JSON format. Using JS to receive is more convenient.
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.