에서 나는 이것을 파악에 약간의 문제가있어 :예상치 못한 T_ELSEIF는
function myMenu() //Creates a menu with a class current to the current page item
{
$menuItems = array (
"Strona Głowna" => "index.php",
"O nas" => "o-nas.php",
"Oferta" => "oferta.php",
"Polecane kierunki" => "polecane-kierunki.php",
"kontakt" => "kontakt.php",
);
foreach($menuItems as $name => $url) {
$class = 'default';
$index = 'index.php';
if ((curPageName() == $url) && (curPageName() !== $index)) {
$class='current';
}
echo "<li><a href='$url' class='$class'>$name</a></li>";
elseif (curPageName() == $index) {
$class='current home';
}
echo "<li><a href='$url' class='$class'>$name</a></li>";
};
};
는 기본적으로 나는 index.php를에만 '현재 집'을 지정하려는. 어쩌면 당신은 더 나은 해결책을 찾을 수 있습니다, 나는 이것에 초보자입니다. 어쨌든,이 날 준다 :
PHP Parse error: syntax error, unexpected T_ELSEIF in ...
어떤 도움이 감사합니다!
알렉스
친구 "}"에 절은이 경우와 다른 경우 – pregmatch