I have a text field retrieved by a Solr query that contains the body of an email. I am trying to replace embedded line breaks with paragraph tags via PHP like so:
$text = $item->Body[0];
$new_line = array("
", "
", "");
preg_replace($new_line,'</p><p>',$text);
echo $text;
When I show the result in my IDE/debugger the newline characters are not replaced and are still there:
I have been going through threads on this site trying patterns suggested by different people including "/\s+/" and PHP_EOL and "/( || )/" and nothing works. What am I doing wrong?