阅读背景:

通过ajax将多个数组传递给javascript

来源:互联网 

To pass an array from PHP to javascript via ajax, I am going to use json_encode, and recieve it on the javascript end. However, I will be returning multiple rows from my MySQL database, and need to return multiple JSON-formatted arrays. One way I thought of doing this was to string the JSON arrays together in php with some obscure character, such as a pipe character, and then separate them on the javascript end. But is there a more elegant way to do this?To pass an array from PHP to javascript via aja




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: