解析错误:语法错误,第44行/home/comp3170-020/public_html/assignment1/index.php中的意外T_ENDIF

时间:2014-02-18 22:04:41

标签: php parse-error

     <?php
    if (!empty($_SESSION['err'])): ?>
    <tr>
      <td width="220" class="content_l" > <font color = "ff0000"> 
       <?php foreach ($_SESSION['err'] as $err): echo $err.'<br>';  ?> </td>
     </tr>
     <?php
     endif;
     unset($_SESSION['err'];
     ?>

继续收到此错误,无法看错。

1 个答案:

答案 0 :(得分:0)

应该是这样的:

   <?php
if (!empty($_SESSION['err'])):
?>
<tr>
  <td width="220" class="content_l" > <font color = "ff0000"> 

   <?php foreach ($_SESSION['err'] as $err){ echo $err.'<br>'; }?> </td>

 </tr>

 <?php
 endif;
 unset($_SESSION['err']);
 ?>