在线表?
你可以显示的时候取模如果$i%7==0
输出<br>或者<tr>
你可以显示的时候取模如果$i%7==0
输出<br>或者<tr>
解决方案 »
- 网站与dz论坛用ucenter整合第一次登陆同步问题.
- wampserver2修改mysql密码之后卸载重载后phpmyadmin拒绝访问
- php 可以根据文件名写cookie么
- 用php计算一年中或者一段日期之内每个星期六的日期?
- 一个php include的问题。求解!
- 小弟新做的站,请大虾们给点意见!
- 一个基础性问题。在一个超链接中同时有href和onclick属性,为什么不行。
- php 读出mysql以后生成excel中文乱码问题求教
- 这样的自动搜索程序怎么写?
- 欲将access转为mysql数据库文件,应该怎么转
- 大家帮我看看这个错误到底要如何解决!急
- PHP和MYSQL,数据库如何连接。在线等待!!!!!!!!!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<table width="600" height="98" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4">
<div align="center">在线用户列表</div></td>
</tr>
<?$alluser=array();
$alluser[]="111";
$alluser[]="222";
$alluser[]="333";
$alluser[]="444";
$alluser[]="555";
$alluser[]="666";
$alluser[]="777";
//给数组赋值$num=count($alluser);
//求出数组中元素的个数$per_row=4;
//假设每行显示4个$row=ceil($num/$per_row);
//计算要循环的次数,也就是打印的行数for($i=0;$i<$row;$i++)
{?>
<tr>
<?for($j=0;$j<$per_row;$j++)
{?>
<td><?=$alluser[($i*$per_row+$j)]?></td>
<?}?>
</tr>
<?}?>
</table>
</body>
</html>