In my email program I use Tidy to clean up the HTML before I send out the emails. A problem is beginning to persist that if I send a mail fetching the html from a url on the web there may exist some javascript in the document.
I want to clean up this html document even more by stripping out all javascript, embedded, referenced and in any form so that the mail exist only of html.
I want to use php's preg_replace()
to strip out all javascript from a mail and I need some help with the best regex because it's not my strongest point i must confess.
echo preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', "", $var);
As shown here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With