duanbu9345 2015-09-19 04:19
浏览 53
已采纳

将双引号连接到单引号字符串是否安全?

Are there any issues I should be aware of when doing the following:

$table_html = '  <td id="unescaped-double-quotes-yay">Some stuff</td>' . "
";

I do not like escaping double quotes withing HTML and I can't stand using single quotes in HTML, my solution is what I have above. Am I going to run into any issues with this practice?

  • 写回答

3条回答 默认 最新

  • dongpouda6700 2015-09-19 04:22
    关注

    I have done this many times on client sites (have since found better alternatives), you are 100% fine.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?