3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = '<!doctype html> <html> <head> <script type="text/javascript">alert(fasdfsd)</script> <meta charset="utf-8"> <script type="text/javascript"> var fasdfsd="fasdfsd"; </script> <script type="text/javascript" src="http://google.adv.js"></script> <title> hey </title> <script> alert("hello"); </script> <script type="text/javascript" src="lfasd.js"></script> </head> <body> hey </body> </html>'; $str = preg_replace("@<script[^>]*?>.*?</script>@siu","",$str); $str = preg_replace("/(\n)*/","\n",$str); echo html_entity_decode($str);
based on FnWFv
Output for 4.3.0 - 7.2.0
< ! d o c t y p e h t m l > < h t m l > < h e a d > < m e t a c h a r s e t = " u t f - 8 " > < t i t l e > h e y < / t i t l e > < / h e a d > < b o d y > h e y < / b o d y > < / h t m l >