Print newline in PHP in single quotes

前端 未结 12 1283
野性不改
野性不改 2020-11-28 21:33

I try to use single quotes as much as possible and I\'ve noticed that I can\'t use \\n in single quotes. I know I can just enter a newline literally by pressing return, but

12条回答
  •  感情败类
    2020-11-28 21:53

    No, because single-quotes even inhibit hex code replacement.

    echo 'Hello, world!' . "\xA";
    

提交回复
热议问题