Parse error: syntax error, unexpected 'endwhile' (T_ENDWHILE)
<?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 的那个版本?
相关推荐
PHP异常Parse error: syntax error, unexpected T_VAR错误解决方法
在PHP编程过程中,开发者可能会遇到各种语法错误,其中“Parse error: syntax error, unexpected T_VAR”是一个常见的错误类型。
PHP Parse Error: syntax error, unexpected $end 错误的解决办法
在本文中,我们将详细探讨"PHP Parse Error: syntax error, unexpected $end"错误的产生原因及其解决办法。
php异常:Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE eval()'d code error
在PHP编程中,遇到标题中所提及的“Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE eval()’d code error
PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法
总的来说,“Parse error: syntax error, unexpected end of file”错误主要是由于PHP代码的语法错误导致的。
php异常:Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACEeval()d code error
在PHP编程中,"Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE eval()'d code" 是一个常见的解析错误,它表明你的代码在编译阶段遇到了语法问题


基础编程
