Home  >  Article  >  Backend Development  >  php怎么生成动态的表格,表头和数据都是动态的?

php怎么生成动态的表格,表头和数据都是动态的?

WBOY
WBOYOriginal
2016-06-13 11:51:201841browse

php如何生成动态的表格,表头和数据都是动态的???
比如说我按时间查询,从7月1日到7月3日,表头就是7.1|7.2|7.3这样的,这个要怎么做??

------解决方案--------------------

<br /><?php<br />	$stime=strtotime('2013-7-1');<br />	$otime=strtotime('2013-7-3');<br />	$i=0;<br />	$arr=array();<br />	for($i=$stime;$stime<=$otime;$stime=$stime+86400)<br />	{<br />		 $arr[]=date('m.d',$stime);<br />	}<br />	$new_arr=implode($arr,'<br><font color='#FF8000'>------解决方案--------------------</font><br>');<br />	print_r($new_arr);<br />?><br />

07.01
------解决方案--------------------
07.02
------解决方案--------------------
07.03
52期李勃然?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn