Re: Re: stripping quotes within an image tag
| From: | electroteque | Date: | Wed, 31 Jul 2002 13:26:04 +0000 |
| Subject: | Re: Re: stripping quotes within an image tag | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110519@lists.php.net to get a copy of this message | ||
easy done but then it would replace all matches ie "blah" in the content
would be removed :|
it worked when i did
$string = "<img height=\"44\" alt=\"\" hspace=\"0\"
src=\"blah.jpg\"
width=\"148\" border=\"0\">";
but when i do
$string ="<table class=\"tablecontent\" cellspacing=\"0\"
cellpadding=\"10\"
width=
\"100%\" border=\"0\">
<tbody>
<tr>
<td><a href=\"blah.php\" target=\"_blank\"><img
height=\"44\" alt=\"\" hspace=\"0\" src=
\"blah.jpg\"
width=\"148\" border=\"0\"></a></td>
<td>View your account information. This option is only available to
investors who have authorised us to make this facility available.
Please contact us if you wish to have enquiry access to your
data.</td>
</tr>
</tbody>
</table>";
this doesnt work
using this echo preg_replace('/(<img.+?src=)"([^"]+)"([^>]*>)/i',
'\1\2\3',
$string);
"Jason Wong" <php-general@gremlins.com.hk> wrote in message
news:200207312116.40139.php-general@gremlins.com.hk...
> On Wednesday 31 July 2002 20:38, electroteque wrote:
> > hmm sorry it didnt seem to work , it did then i gave it more than an
img
> > tag in a string and now it doesnt
>
> If all you're doing is stripping the double-quotes why don't you use
> str_replace() as someone suggested?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Denver, n.:
> A smallish city located just below the `O' in Colorado.
> */
>