not getting what the error is everythin looks perfect to me

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mayanktalwar1988
Forum Contributor
Posts: 133
Joined: Wed Jul 08, 2009 2:44 am

not getting what the error is everythin looks perfect to me

Post by mayanktalwar1988 »

Code: Select all

foreach($routearr as $value)
    {
    if($value==(change here at kashmere gate ) || $value==(change here at rajiv chowk ) ||  $value==(change here at yamuna bank )   )
    {
    echo "<br>";
    echo "<div style=\"color:#8e0b0b\" > $value</div>";
    }
    else
    echo "<span style = \"color:#f80a0a\" >$value</span>";
    }
in above code line 3 gives this error Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\knowdelhi\metro\metrosubmit.php on line 2009
line 2009 in the error is line three here.when i comment out this piece of code everything works ok but when i remove the above code form comments the error again creeps in so error must be in above code..but it looks ok to me...
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: not getting what the error is everythin looks perfect to me

Post by Christopher »

I am guessing that line should be something like:

Code: Select all

    if(($value=='change here at kashmere gate') || ($value=='change here at rajiv chowk') ||  ($value=='change here at yamuna bank')   )
(#10850)
Post Reply