我正在构建菜单,我希望它由用户级别控制。我有一个if语句,它回显了要显示的链接。但是,我没有显示整个子菜单,而是想将其分解为更多if语句。我该怎么做?
如果我没有任何意义,这是我的代码:
if (!isset($logged)) {
echo "";
} else {
echo "
Useful Infoif ($metric == "admins" || $metric == "management" || $metric == "executives" || $metric == "god") {
echo
"
Services Sub Menu 2"}
"
About Services Sub Menu 4";}
?>
这是答案后的代码:
if (!isset($logged)) {
echo "";
} else {
echo "
Useful Infoif ($metric == "admins" || $metric == "management" || $metric == "executives" || $metric == "god") {
echo
"
Services Sub Menu 2";}
else {
echo "";
}
"
About Services Sub Menu 4";}
?>