Thank you, Phil, for fixing that. Obviously this snippet is trying to be a
smaller test case for a much
larger problem. It looks like I'm pulling *all* of the <img> and <a href>
from the $string and I don't
want that at all. I just want one of them.
So, my return is:
image source:http://www.123posters.com/images/m-mase01.jpg" alt="Mase
Necklace"></a> <img src="http://www.qksrv.net/image-297915-361662"
height="1" width="1" border="0
href: http://www.qksrv.net/click-297915-361662" target="_top" > <img
src="http://www.123posters.com/images/m-mase01.jpg" alt="Mase
Necklace"></a> <img src="http://www.qksrv.net/image-297915-361662"
height="1" width="1" border="0
I mistakenly though it would stop at the second ", but it's going all
the way to the end. Is there any way to tell it to
find one instance instead of the globalizing like it's doing?
I'm going to play around with a few more things, but after staring at the
code for 4 hours, my brain is fried.
Thanks,
Lara
At 06:59 PM 7/12/2001 -0700, Lara J. Fabans wrote:
>---------
><?php
>
>$string = "<a href="http://www.qksrv.net/click-297915-361662"
>target="_top" > <img
>src="http://www.123posters.com/images/m-mase01.jpg"
>alt="Mase Necklace"></a> <img
>src="http://www.qksrv.net/image-297915-361662"
>height="1" width="1" border="0">";
>
>if (ereg ("img src="(.*)"", $string, $regs))
>{
> echo "image source:$regs[1]<br>";
>} else
>{
>echo "nope1";
>}
>
>if (eregi("a href="(.*)"", $string, $regs))
>{
>echo "href: $regs[1]<br>";
>} else
>{
>echo "nope2";
>}
>?>
---------------------
Lara J. Fabans
Lodestone Software, Inc
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]