I have a textarea field on a form that a user submit and it gets saved to a MySQL database. When I retrieve the value, I'm running nl2br to convert the line breaks to br tags. Then I'm using str_replace to replace the double br's with p tags. The issue is nothing is being replaced. I've looked at this over and over and just can't figure out what could be wrong.
Here's the HTML output:
Windows XP Home / Professional
<br />(32 and 64 bit)
<br />
<br />Test Operating System 2
<br />(32 and 64 bit)
<br />
<br />Test Operating System 3
<br />(64 bit)
Here's my PHP:
$FORMATTED = str_replace("<br /><br />", "</p><p>", $SUPPORTED_PLATFORMS);
The output of $FORMATTED looks exactly the same as the HTML output above. I essentially want to replace all the back to back br tags with the p tag and leave all the single br tags the way they are.
Thank you!!