Azu Posted December 1, 2006 Share Posted December 1, 2006 $post=preg_replace("/(\r\n|\n|\r)/", "<br>",$post)Why doesn't this work?$post=preg_replace("!\s+!","<br>",$post);Or this?$post=nl2br($post);Or this?None of them are taking out the newlines from $post :( $post is $_POST from a text field on a forum I'm makingWhat do I have to do to replace the "newlines" or "enters" or whatever they are called, with <br> ?Please help :-\ Link to comment https://forums.phpfreaks.com/topic/29128-solved-nl2br/ Share on other sites More sharing options...
craygo Posted December 1, 2006 Share Posted December 1, 2006 I use this[code]$newpost = str_replace(array("\n","\r","\t"),'',$post);[/code]Ray Link to comment https://forums.phpfreaks.com/topic/29128-solved-nl2br/#findComment-133624 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.