Re: ereg_replace: Help!
| From: | Plutarck | Date: | Tue, 24 Apr 2001 00:45:44 +0000 |
| Subject: | Re: ereg_replace: Help! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49971@lists.php.net to get a copy of this message | ||
This works:
$str = '<IMG ALT="Tools" BORDER=0 HEIGHT=55
SRC="images/headers/tools.gif"
WIDTH=455>';
echo eregi_replace("<IMG.+SRC=\"images/headers.*>", "Replaced",
$str);
--
Plutarck
Should be working on something...
...but forgot what it was.
"Erica Douglass" <corky6921@yahoo.com> wrote in message
news:5.0.2.1.2.20010423172444.00b0fe18@mail.brightmail.com...
> I have one ereg_replace problem that I cannot seem to fix.
>
> I need to delete an IMG tag. The only thing I know about this tag is that
> it will contain
>
> SRC="images/headers
>
> in the string. Here is an example:
>
> <IMG ALT="Tools" BORDER=0 HEIGHT=55 SRC="images/headers/tools.gif"
WIDTH=455 >
>
> I tried this, but it didn't work:
>
> $contents = ereg_replace ("<IMG.*images/headers.*>", "", $contents);
>
> Can someone please help?
>
> Thanks,
> Erica
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>