开发者

How to store php array in jquery variable?

Is it posible to store php array in jquery variabl开发者_C百科e?


Yes it is.

You can json_encode your array in PHP and then use it with jQuery via a getJSON request.

See: http://php.net/json_encode and http://api.jquery.com/jQuery.getJSON/


you can either use a json request or store the variable on a hidden fiel on page load and read it with jquery

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜