Jump to content

[SOLVED] nl2br


Azu

Recommended Posts

$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 making


What 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.