Scott Meyers Posted March 24, 2011 Share Posted March 24, 2011 I am not a php programmer. I just need to replace nl2br with <p> at the beginning of the paragraph and </p> and the end of the same paragraph. Here is the code I have and need to modify: $text = nl2br($text); $this->setText($text); return $this; Currently the text is posted like this:BLAH BLAH<br />I need it this way:<p>BLAH BLAH</p>Any help is greatly appreciated. Thank you Link to comment Share on other sites More sharing options...
paul Posted March 24, 2011 Share Posted March 24, 2011 $text = nl2br($text);$text = ' '.str_replace(array(' ',' ','',''),array('','',' ',' '),$text).'';$this->setText($text);return $this; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now