note 29537 added to function.ereg-replace

From: Date: Sun, 16 Feb 2003 22:48:45 +0000
Subject: note 29537 added to function.ereg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-44072@lists.php.net to get a copy of this message
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! -- http://www.php.net/manual/en/function.ereg-replace.php http://master.php.net/manage/user-notes.php?action=edit+29537 http://master.php.net/manage/user-notes.php?action=delete+29537 http://master.php.net/manage/user-notes.php?action=reject+29537

« previous php.notes (#44072) next »