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.
任何人都可以帮助这种格式。我在数据库中有一段说(例如)“黑色;蓝色;绿色”,我想从数据库中调用它,格式为 ; 成为新行\n。
所以它变成了
black blue green
有任何想法吗?
$string = str_replace(';', "\n", $string);
$str = str_replace(";", "\n", $string);
找到;并用换行符替换它。
;
参考这个了解更多