Parse error: syntax error, unexpected 'endwhile' (T_ENDWHILE)

handsome1234 handsome1234 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
php 7.3.4.nt


<?php
$users=[['name'=>'大叔','age'=>'16',],
['name'=>'小米','age'=>'19',],
['name'=>'小明','age'=>'23',],
['name'=>'小军','age'=>'16',],
['name'=>'小强','age'=>'19',],
];
?>
<table border="1">
<tr>
<th>编号</th>
<th> 姓名</th>
<th> 年龄</th>
</tr>
<?php
while ($user = current($users)) ;?>
<tr>
<td> <?php echo key($user) + 1; ?></td>
<td><?php echo $user['name']; ?></td>
<td><?php echo $user['age']; ?></td>
</tr>
<?php next($users);endwhile:?> //这句报错:Parse error: syntax error, unexpected 'endwhile' (T_ENDWHILE), expecting end of file in D:\phpstudy_pro\WWW\yhj.php on line 78
</table>


另外这个while后面部分应该 有{}括号的,也没有,视频上居然也没报错,真怀疑他是book air 下 php 的那个版本?
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
handsome1234
基础编程 21,889 成员 140,329 内容