Sending HTML Code Through JSON

前端 未结 7 1096
暗喜
暗喜 2020-11-30 07:07

I\'ve got a php script which generates HTML content. Is there a way to send back that HTML content through JSON to my webpage from the php script?

7条回答
  •  佛祖请我去吃肉
    2020-11-30 07:55

    All these answers didn't work for me.

    But this one did:

    json_encode($array, JSON_HEX_QUOT | JSON_HEX_TAG);
    

    Thanks to this answer.

提交回复
热议问题