Parse error: syntax error unexpected end of file in php

Parse error: syntax error unexpected end of file in php

这是我的代码,我检查了所有右大括号和左大括号,我也没有在任何地方使用它的缩写 php 并且我不会错过 ';',
我不知道为什么它显示解析错误:

<html>
 <head>

  <script type="text/javascript" src="<?php echo base_url('assests/js/jquery.min.js') ?>"></script>
  <link rel="stylesheet" type="text/css" href="<?php echo base_url('assests/css/bootstrap.min.css') ?>">
  <script type="text/javascript" src="<?php echo base_url('assests/js/bootstrap.min.js') ?>"></script>
 </head>
  <body>
   <div class="container">
    <table class="hover hover-table">
       <tr>
        <th>No</th>
        <th>Code</th>
        <th>Name</th>
        <th>Address</th>
       </tr>
       <?php if(count($all_user>0))
         { $i=0;
       foreach ($all_user as $user) 
          {

           $i++;
       ?>
     <tr>
      <td><?php echo $i ?></td>
      <td><?php echo $user->code ?></td>
      <td><?php echo $user->name?></td>
      <td><?php echo $user->address ?></td>
    </tr>
         }
      }
  </table>
 </div>

  </body>
  </html>

您在花括号 <?php }} 之前缺少结束 php 标记。因此你得到 Line : 36 -- syntax error, unexpected end of file

试试这个方法,

<html>
 <head>
  <script type="text/javascript" src="<?php echo base_url('assests/js/jquery.min.js') ?>"></script>
  <link rel="stylesheet" type="text/css" href="<?php echo base_url('assests/css/bootstrap.min.css') ?>">
  <script type="text/javascript" src="<?php echo base_url('assests/js/bootstrap.min.js') ?>"></script>
 </head>
  <body>
   <div class="container">
    <table class="hover hover-table">
       <tr>
        <th>No</th>
        <th>Code</th>
        <th>Name</th>
        <th>Address</th>
       </tr>
       <?php if(count($all_user>0))
         { $i=0;
       foreach ($all_user as $user) 
          {

           $i++;
       ?>
     <tr>
      <td><?php echo $i ?></td>
      <td><?php echo $user->code ?></td>
      <td><?php echo $user->name?></td>
      <td><?php echo $user->address ?></td>
    </tr>
       <?php
         }
       }
      ?>
  </table>
 </div>

  </body>
  </html>

您缺少打开和关闭php

    </tr>
    <?php } /* endforeach */
      } /* endif */ ?>
  </table>

这就是您遇到错误的原因。