```php
$value='<p>'.str_replace(array("\n", "\r\n", "\r"), '</p><p>',$value).'</p>';
```
str_replace is faster