Thanks Greg,
That sorted that out nicely :-)

Dave Carrera


-----Original Message-----
From: greg [mailto:[EMAIL PROTECTED] 
Sent: 09 May 2004 14:17
To: Dave Carrera
Subject: Re: preg_replace to delete all js code in string help needed


Dave Carrera wrote:
> $text2 = preg_replace("/<script[^>]+>.*?<\/script>/is","",$text2);
> 
> Leaves output with "language="javascript" blah blah
> 
> Dose anyone know of a pattern that will get rid of ALL javascript from 
> a string.
> 
> Thank you for any help
> 
> Dave Carrera
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004
>  

Try $text2 = preg_replace("/<script[^>]*>.*<\/script>/is","",$text2)

It works for me.

Greg


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to