我有以下字符串。我想用/n 替换换行符
Good FRIENDS are hard to find,<br
/> harder to leave,<br
/> and impossible to forget.
最佳答案
preg_replace("/<br\W*?\/>/", "\n", $your_string);
关于php - 从php中的字符串替换br标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5849130/