Submitted by fabio on Mon, 2010-09-20 17:04.
If you need to strip out the tag script using PHP from a multiple line text (eg an html page, an RSS feed, an XML document) you can simply use the following PHP preg_replace instruction:
$content_filtered = preg_replace("/.*?<\/script>/xmsi", "", $content);
In the above code, $content contains your raw multiple line html and $content_filtered will contain the filtered version of $content.
Using that preg_replace instruction is demontrated in the attached php file.
Recent comments
21 hours 24 min ago
1 day 12 hours ago
1 day 15 hours ago
1 day 15 hours ago
1 day 16 hours ago
1 day 19 hours ago
2 days 1 hour ago
2 days 3 hours ago
2 days 9 hours ago
2 days 9 hours ago