fork download
  1. <?php
  2.  
  3. $text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
  4. echo strip_tags($text, '');
  5. echo "\n";
  6. echo preg_replace('/<[^>]*>/', '', $text)
  7.  
  8. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Test paragraph. Other text
Test paragraph. Other text