madrazel Posted May 14, 2007 Share Posted May 14, 2007 in example: <script /*whatever here*/> /*anything between, Chinese, Korean, Arabic characters, line breaks etc..*/ </script> i done this: $str = preg_replace('/<script(\n|\t|-|[[]|[]]|[a-z0-9!?@&%*+<>(){};:,._=\'"\/| ])+<\/script>/i','', $str); but it still occasionally leaves behind some tags.. Link to comment https://forums.phpfreaks.com/topic/51357-solved-how-to-completely-remove-tak-from-html-source/ Share on other sites More sharing options...
Wildbug Posted May 14, 2007 Share Posted May 14, 2007 Um, why didn't you just use: $str = preg_replace('|<script.*?</script>|is','',$str); Link to comment https://forums.phpfreaks.com/topic/51357-solved-how-to-completely-remove-tak-from-html-source/#findComment-253056 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.