Posted By

luman on 08/31/06


Tagged

paragraph


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

d4rk
skywalker


nl2p


 / Published in: PHP
 

URL: http://es.php.net/manual/es/function.nl2br.php#60381

Change \n for \r\n\r\n

  1. function nl2p($text) {
  2. return "<p>" . str_replace("
  3.  
  4. ", "</p>
  5. <p>", $text) . "</p>";
  6. }

Report this snippet  

You need to login to post a comment.