且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何阅读“,"如&quot;<br/>&quot;在 PHP/MySQL 中?

更新时间:2022-12-08 13:11:21

假设没有 CSV 引用问题:

Assuming there are no CSV quoting issues:

$newStr = str_replace( ',', '<br>', $string );

在看到您的回滚后,我发现您实际上想将 , 替换为 newline 字符,例如 \r, \n\r\n:

After seeing your rollback, i see that you actually want to replace the , with a newline character such as \r, \n or \r\n:

$newStr = str_replace( ',', "\n", $string );