title: Removing html tags without breaking lines with php
body: <p>I'm using an api and I need to get the description of product registrations from a certain store. But the product registration comes in html format and the api does not accept HTML. I've used strip_tags from php to remove the html tags, but it does not keep the line breaks of the text (). Is there any way to do something like this?</p>
  
  <pre><code>  $description = ($product-&gt;description != "") ? strip_tags($product-&gt;description) : trim($product-&gt;name);
    $description = nl2br($product-&gt;description);
  </code></pre>