You need to do this:
foreach ($menu_items as $item=>$value) {
if($item != 'about-me'){
echo '<a href="#'.$item.'">'.$value.'</a>'; //change here
}else if($item == 'about-me'){
echo '<a href="#'.$item.'">about</a>';
}
}
You are using $item, use the $value instead of $item.
0
solved How can I show array in PHP?