Making a new line with single quotes?

后端 未结 4 655
鱼传尺愫
鱼传尺愫 2020-12-21 10:03

Can I do a line break like this \'\\n\'?

Or do I must use double quotes - \"\\n\"?

4条回答
  •  鱼传尺愫
    2020-12-21 10:46

    To output a newline (or any other control character for that matter) you must always use double quotes.

    An alternative to not use double quotes is chr() with the respective ASCII code as an argument:

    echo chr(10); // same as echo "\n";
    

提交回复
热议问题