dongsong1911 2013-05-21 09:27
浏览 29
已采纳

在javascript数组中转换Php数组

I have php array like this

[0]->imgae_name=1
 image_url=a

[1]->imgae_name=2
 image_url=b

i want to convert this array in javascript array how can i do this?

  • 写回答

3条回答 默认 最新

  • douxianji3367 2013-05-21 09:29
    关注

    You could convert the PHP array to JSON using json_encode, then echo the json string into the Javascript in your page and use Javascript JSONObject to convert it into a JS array

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?