New Line on PHP CLI

后端 未结 4 575
暗喜
暗喜 2021-01-31 12:55

I have a php CLI script and cannot get the output to break on new lines. I do

echo \'this is my text\\r\\n\';
echo \'next line\';

This gives

4条回答
  •  野性不改
    2021-01-31 13:42

    Escape sequences are only parsed when inside double quotes, not single quotes.

    http://php.net/manual/en/language.types.string.php

提交回复
热议问题