从php中的字符串替换br标签 [英] replace br tag from a string in php
本文介绍了从php中的字符串替换br标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下字符串.我想将换行符替换为/n
I have the following string. I want to replace the line break with /n
Good FRIENDS are hard to find,<br
/> harder to leave,<br
/> and impossible to forget.
推荐答案
preg_replace("/<br\W*?\/>/", "\n", $your_string);
这篇关于从php中的字符串替换br标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文