这个问题在这里已有答案:
这是我的代码,我检查所有关闭和打开括号,我也没有在任何地方使用它的简短形式的PHP我不't miss ';',
我不知道为什么它显示解析错误:
<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>
2 回答
你缺少打开和关闭PHP
这就是你得到错误的原因 .
在花括号
<?php }}
之前你错过了关闭的php标签 . 因为你得到Line : 36 -- syntax error, unexpected end of file
试试这个,