Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以通过以下方式以编程方式保存商店地址
$_address=nl2br('123\nTest',false); $config->saveConfig('general/store_information/address',$_address,'default',0);
但问题是\n即使我使用也没有转换成新行nl2br。可能是什么问题?
\n
nl2br
在 php 字符串中使用 \n、\r 或 $someVar 时,您需要使用双引号。
试试这个:
$_address=nl2br("123\nTest",false);