gpt4 book ai didi

php - PHP CLI 上的新行

转载 作者:IT老高 更新时间:2023-10-28 11:53:26 25 4
gpt4 key购买 nike

我有一个 php CLI 脚本,无法让输出换行。我愿意

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

这给了

this is my text\r\nnext line

关于如何在不同的行上获得输出有什么想法吗?

最佳答案

使用双引号".

echo "next line\n";

另外你可以使用系统相关的常量PHP_EOL

echo "this is my text" . PHP_EOL;

关于php - PHP CLI 上的新行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6818875/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com