fork(1) download
  1. <?php
  2.  
  3. $html = "
  4. <p>algo</p>
  5. <script>alguma funcao javascript</script>
  6. <div>algo</div>
  7. ";
  8.  
  9. $html_limpo = preg_replace('/<script[^>]*>[^<]*<\/script>/', '', $html);
  10. echo $html_limpo;
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
<p>algo</p>

<div>algo</div>