开发者

How to store php array in jquery variable?

开发者 https://www.devze.com 2023-03-29 23:02 出处:网络
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.

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

精彩评论

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