Is it correct to use single quotes for HTML attributes?

前端 未结 15 2714
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 05:57

Recently I\'ve been seeing a lot of this:


    

        
15条回答
  •  执念已碎
    2020-12-01 06:39

    When using PHP to generate HTML it can be easier to do something like:

    $html = "";
    

    than concatenating a string with a variable with a string, as PHP parses variables in double-quoted strings.

提交回复
热议问题