How to remove javascripts from a page using Php

Here is the little code that will help you to remove Javascripts from a page using php

<?
$file=file_get_contents(”http://www.ramanean.com”);

$file = preg_replace(’#<\s*script[^>]*?>.*?<\s*/\s*script\s*>#si’, ”, $file);

echo $file;
?>

Now the web page will be displayed without javscripts

Leave a comment

Your comment