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
jsweazy
Forum Newbie
Posts: 2 Joined: Sat Mar 06, 2010 12:10 am
Post
by jsweazy » Sat Mar 06, 2010 12:13 am
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
Post
by mikosiko » Sat Mar 06, 2010 12:32 am
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
Post
by jsweazy » Sat Mar 06, 2010 12:42 am
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
Post
by mikosiko » Sat Mar 06, 2010 12:44 am
don't sweat... been there myself more than one time also