note 29537 deleted from function.ereg-replace by tularis
| From: | tularis@php.net | Date: | Sun, 29 Aug 2004 12:14:16 +0000 |
| Subject: | note 29537 deleted from function.ereg-replace by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75558@lists.php.net to get a copy of this message | ||
Note Submitter: schwarzie at sympatico dot ca
----
For the above procedure, I used the following code. I should have posted in another forum, but
there might be others looking for the same thing.
The following code will remove the javascript tags from an html file (this is good if you parse
pages from another server to your own Web site, good at avoiding using frames).
USING THE PREG_REPLACE function
$file = "http://somewhere.com/somefile.html";
$extract = file_get_contents ($file);
$extract = preg_replace("'<script[^>]*?>.*?</script>'si",
"", $contents);
echo $extract;
Thank you!