how to use JSON.stringify and json_decode() properly

后端 未结 7 1677
野性不改
野性不改 2020-12-08 06:08

Im trying to pass a mulitidimensional Javascript array to another page on my site by:

  • using JSON.stringify on the array

  • assigning the result

7条回答
  •  粉色の甜心
    2020-12-08 06:48

    You'll need to check the contents of $_POST["JSONfullInfoArray"]. If something doesn't parse json_decode will just return null. This isn't very helpful so when null is returned you should check json_last_error() to get more info on what went wrong.

提交回复
热议问题