Keep Getting Parse Error: Parse Error

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
jsweazy
Forum Newbie
Posts: 2
Joined: Sat Mar 06, 2010 12:10 am

Keep Getting Parse Error: Parse Error

Post by jsweazy »

Hey everyone,

If you guys could help me that would be awesome. I have more code than this but this is where it is giving me the error:

Code: Select all

foreach ($menu_items as $item){
    if ($item['id'] == $id){
        menu .= "<li class='current'>"; //says error is on this line
    }else {
        menu .= "<li>";
    }
}
Thanks in advance for your help
mikosiko
Forum Regular
Posts: 757
Joined: Wed Jan 13, 2010 7:22 pm

Re: Keep Getting Parse Error: Parse Error

Post by mikosiko »

from the PHP manual
Basics

Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive
jsweazy
Forum Newbie
Posts: 2
Joined: Sat Mar 06, 2010 12:10 am

Re: Keep Getting Parse Error: Parse Error

Post by jsweazy »

oh thank you so much... i feel retarted. I stared at this code forever
mikosiko
Forum Regular
Posts: 757
Joined: Wed Jan 13, 2010 7:22 pm

Re: Keep Getting Parse Error: Parse Error

Post by mikosiko »

don't sweat... been there myself more than one time also :)
Post Reply