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
精彩评论