PHP arrays into javascript arrays

前端 未结 6 533
伪装坚强ぢ
伪装坚强ぢ 2021-01-17 01:41

I am a bit confused here on how I implement an array into JS from PHP....

I\'m doing this for testing - eventually I\'ll use long polling or websockets if they get h

6条回答
  •  余生分开走
    2021-01-17 02:02

    Not sure why you need to wrap the json string in an Array, you could just do

    var data = ;
    

    --

    To get the value of data in your js, you can either do data.x or data["x"]

提交回复
热议问题