Taking .get json string, turn into array?

后端 未结 2 960
生来不讨喜
生来不讨喜 2021-01-29 06:46

Im using the following to retrieve a string from php, i would like to know how to make my string into an array.

Jquery

$.get(\"get.php\"         


        
2条回答
  •  独厮守ぢ
    2021-01-29 07:01

    You are getting JSON out in that callback already. It doesn't look like it because when you "alert" it gets converted to a string that consists of a comma delimited list of the array elements.

    You can see this by doing alert(data instanceof Array); which will spit out "true".

提交回复
热议问题