开发者

php string replace without empty space

I'm using str_replace to remove some tags within a string, it's being replaced with just '' but the line is still there, an empty line. I tried to remove \r\n and variations of, and开发者_运维问答 nothing will remove the empty line, without messing up other formatting.

Is there a way to replace an item in a string without leaving an empty line?

Thanks!


Wrap str_replace with trim.


Perform second replacement that removes empty lines

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜