// 定义每排最多坐4人
$maxLine = 4;
// 确定学生编号为17
$no = 17;
// ceil()的作用是向上取整,以这里为例,17除以4等于4.25,所以向上取整就是5。17号的学生要坐在第五排。
$line = ceil($no/$maxLine);
// 重点在下面这句三元运算符(D = A ? B : C),如果A≠0,D=A;如果A=0,D=C。以这里为例,17÷4=4余1(17%4=1),即A=1,所以D=1。
$row = $no%$maxLine?$no%$maxLine:$maxLine;
$maxLine = 4;
// 确定学生编号为17
$no = 17;
// ceil()的作用是向上取整,以这里为例,17除以4等于4.25,所以向上取整就是5。17号的学生要坐在第五排。
$line = ceil($no/$maxLine);
// 重点在下面这句三元运算符(D = A ? B : C),如果A≠0,D=A;如果A=0,D=C。以这里为例,17÷4=4余1(17%4=1),即A=1,所以D=1。
$row = $no%$maxLine?$no%$maxLine:$maxLine;
2015-12-12
我饿啦:-(
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
终于吃饱啦^_^
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
我还没吃饱呢!
终于吃饱啦^_^
2015-12-12