Putting HTML in JSON

后端 未结 3 703
不知归路
不知归路 2020-12-18 21:30

As per title, is it considered a good practice to put HTML in JSON? The reason I need to do this is because I would like to have a custom dropdown where the list is coming f

3条回答
  •  星月不相逢
    2020-12-18 22:04

    There's nothing wrong with it. json_encode escapes all characters anyway, so the only thing you have to beware of is make sure your strings are utf8_encoded.

提交回复
热议问题