Re: Eregi_replace for font tags?!?
| From: | Ignatius Reilly | Date: | Mon, 07 Oct 2002 13:24:37 +0000 |
| Subject: | Re: Eregi_replace for font tags?!? | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-16221@lists.php.net to get a copy of this message | ||
Try:
$patterns = array(
"/<FONT([[:alnum:]]|[[:space:]]|_|\'|\"|=)*>/" ,
etc
) ;
$replace = array(
"replacement_string" ,
etc
) ;
$text = preg_replace( $patterns, $replace, $text ) ;
Deserves to be tested extensively, though, depending on what you may have in
your data
HTH
Ignatius
____________________________________________
----- Original Message -----
From: "Leon" <ljansen@its.uct.ac.za>
To: <php-windows@lists.php.net>
Sent: Monday, October 07, 2002 2:53 PM
Subject: [PHP-WIN] Eregi_replace for font tags?!?
> Hi all
>
> I would like to know if anyone on this list has a possible solution for
> replacing FONT tags in HTML being submitted to a site.
>
> My idea was to use eregi_replace ... but how do I tell eregi_replace to
take
> a string that starts with '<font' and ends with '>' and replace it.
> This
is a
> variable string of course because of the input and needs to work
differently
> for different inputs.
>
> This is for the use of stylesheets.... thus <font class instead of all
> others.
>
> Thanks and Cheers
>
>
> Leon Jansen van Nieuwenhuizen
> Personal Computing Services
> Information & Communication Technology Services
> University of Cape Town
> Phone (Work): +27 21 650 3683
> Phone (Cell): +27 82 44 66 743
> Email: ljansen@its.uct.ac.za
> __________________________
> __________________________
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>