{loop $datas $r}
{if $r[inputtime]}
<li><span class="rt">{date('Y-m-d H:i:s',$r[inputtime])}</span>·<a href="{$r[url]}" target="_blank"{title_style($r[style])}>{$r[title]}</a></li>
{/if}
{if $n%5==0}<li class="bk20 hr"></li>{/if}
{/loop}
把有时间的显示出来即可。
计算日期差的例子代码:<?php
$Dob='2003-01-23'//在你的程序中要使用$_POST获取
list($y,$m,$d)=explode('-',$Dob)
$age=ceil((time()-mktime(0,0,0,$m,$d,$y))/3600/36/365)
echo "$age\n"//这就能输入实满年龄:5岁
?>
相信你能仿照我上面的例子,编写出你满意的程序。
输入内容自动转换为大写的代码我在这个帖子中回答了你的:http://zhidao.baidu.com/question/92757708.html
如果你不使用我那个帖子的方法,也可以在PHP里面使用strtoupper函数进行转换,例如:
$Dob = strtoupper($_POST['dob'])//以post方式接收信息
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)