发生此错误是什么错误PHP语法错误,意外的'endforeach'(T_ENDFOREACH)

时间:2019-01-20 16:01:04

标签: php

此代码有什么问题?

<?
$pages = array();
$pages["New_Student.php"] = "New_Student";
$pages["NewCourse.php"] = "NewCourse";
$pages["Payment.php"] = "Payment";
$pages["Newcontract.php"] = "New contract";
$pages["New_user.php"] = "New User";
$pages["logout.php"] = "Logout";
$activePage = "Admin_dashboard.php";
           foreach($pages as $url=>$title):?>
       <a <?php if($url === $activePage):?>class="current-demo" <?php endif; ?> href="<?php echo $url;?>">
         <?php echo $title;?>
      </a>
<?php endforeach; ?>

解析错误:语法错误,意外的'endforeach'(T_ENDFOREACH),预期文件结尾

0 个答案:

没有答案