how to use JSON.stringify and json_decode() properly

后端 未结 7 1672
野性不改
野性不改 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:56

    When you use JSON stringify then use html_entity_decode first before json_decode.

    $tempData = html_entity_decode($tempData);
    $cleanData = json_decode($tempData);
    

提交回复
热议问题