How to use single quote inside an echo which is using single quote

前端 未结 7 868
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 12:04

First of all, i have gone through the related questions.. haven\'t found any answer.. I m using this code to display a message

echo \'Here goes your message wi

相关标签:
7条回答
  • 2020-11-28 12:54

    In PHP, the escape sequence character is the backslash (\). You can add this before special characters to ensure that those characters are displayed as literals. For example:

    echo 'Here goes your message with an apostrophe S like thi\'s ';
    

    Or you can also write like this:

    echo "Here goes your message with an apostrophe S like thi's ";
    
    0 讨论(0)
提交回复
热议问题