问答详情
源自:5-9 PHP中的算术运算符(2)

请问下哪里出错,老是这样的

<?php 

     $maxLine = 4; //每排人数

$no = 17;//学生编号


$line=ceil($no/$maxline);

$row=$no%$maxline?$no%$maxline:$maxline;


echo "编号<b>".$no."</b>的座位在第<b>".$line."</b>排第<b>".$row."</b>个位置";

?>

Notice: Undefined variable: maxline in /54/879/Hg57/index.php on line 5

Warning: Division by zero in /54/879/Hg57/index.php on line 5

Notice: Undefined variable: maxline in /54/879/Hg57/index.php on line 6

Warning: Division by zero in /54/879/Hg57/index.php on line 6

Notice: Undefined variable: maxline in /54/879/Hg57/index.php on line 6
编号17的座位在第0排第个位置

提问者:彼此依赖 2016-12-06 14:19

个回答

  • 只是一个小前端
    2016-12-06 14:25:48
    已采纳

    大小写注意~maxLine~