$data =input('post.');//用户唯一标识$goods = $data['goods'];
        $shopcuxiao=$data['shopcuxiao'];

        $goods=htmlspecialchars_decode($goods);
        $goodslist=html_entity_decode($goods);
        $goodslist=    json_decode($goodslist,true);

 

接收到的$goods是被转义成

[{"img":"upload/pinpai/img/20180930/60f3860ffe198c67e745b873dd884bbd.jpg","shopPrice":"22","goodsName":"22","ptnum":null},{"img":"upload/pinpai/img/20180930/be60908972d5cc964dfb2acc7a25cf73.jpg","shopPrice":"11","goodsName":"11","ptnum":null}]

可以用函数htmlspecialchars_decode和html_entity_decode进行转义,这样可以得到正确的json数据

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
  • 2021-04-22
  • 2021-04-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2023-03-06
  • 2021-12-15
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案