Escape quotes in a variable with PHP

后端 未结 7 693
温柔的废话
温柔的废话 2021-01-12 03:16

I use this code to genefate html

echo \"\";

Everything would be OK unles

7条回答
  •  情歌与酒
    2021-01-12 03:33

    This works for me...

    echo ''.$table.'';
    

    It's not necessary to use backslaches for escaping when using single quote for echo. Single quote have my vote to work with both php and javascript + html tag.

提交回复
热议问题