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
22 hours 40 min ago
1 day 14 hours ago
1 day 17 hours ago
1 day 17 hours ago
1 day 17 hours ago
1 day 20 hours ago
2 days 2 hours ago
2 days 4 hours ago
2 days 10 hours ago
2 days 11 hours ago