fork download
  1. <?php
  2.  
  3. $html_str = "<p>This is <span class='some_class'>some</span> text, yeah!<br>Hello world.</p>";
  4.  
  5. echo strip_tags($html_str, '<p>') . "\n";
  6.  
  7. echo strip_tags($html_str, '<br>') . "\n";
  8.  
  9.  
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
<p>This is some text, yeah!Hello world.</p>
This is some text, yeah!<br>Hello world.