Hi Lara,

The problem isn't with the if(ereg) line, its the line above.

Put a semi-colon at the end of your $string = "..[snip].." line

Cheers

-------------------------------- -  -- -  -   -
Philip Murray - Senior Systems Engineer
[EMAIL PROTECTED] - Open2View.com
http://www.open2view.com
------------- -  -- -   -

----- Original Message -----
From: "Lara J. Fabans" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 13, 2001 1:59 PM
Subject: [PHP] ereg parse error problem


> Hi, friends,
>
> I'm receiving a parse error on the if (ereg... )
> lines of this code.  I looked at the online manual and modeled my two
> ereg's after it.
> When I kept getting parse errors, I decided to copy the original from the
> manual into
> my code, and it too received a parse error.
>
> Can someone please help me resolve this?
>
> Thank you,
>
> Lara
>
>
> ---------
> <?php
>
> $string = "&lt;a href=&quot;http://www.qksrv.net/click-297915-361662&quot;
> target=&quot;_top&quot; &gt; &lt;img
> src=&quot;http://www.123posters.com/images/m-mase01.jpg&quot;
> alt=&quot;Mase Necklace&quot;&gt;&lt;/a&gt; &lt;img
> src=&quot;http://www.qksrv.net/image-297915-361662&quot;
> height=&quot;1&quot; width=&quot;1&quot; border=&quot;0&quot;&gt;"
>
> if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $string, $regs))
> {
>      echo "$regs[3].$regs[2].$regs[1]";
> } else {
>      echo "Invalid date format: $date";
> }
>
>
> if (ereg ("img src=&quot;(.*)&quot;", $string, $regs))
> {
>         echo $regs[1];
> } else
> {
> echo "nope1";
> }
>
> if (eregi("a href=&quot;(.*)&quot;", $string, $regs))
> {
> echo $regs[1];
> } 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]
>
>


-- 
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]

Reply via email to