php能否实现文章太长的时候分页?
就是在后台发布文章的时候,如果一篇文章太长了,能否分页显示?...
作者 cyber 发布于 0000-00-00 分类:php基础编程
计算年龄时我用这个函数获得年龄
function get_age($birth){
//thank Grimmi Meloni for following 8 line codees.
$year=split("-",$birth);
$time=getdate();
$a=mktime(0,0,0,$time[mon],$time[mday],$time[year]);
$b=mktime(0,0,0,$year[1],$year[2],$time[year]);
$age=$time[year]-$year[0];
if ($a<$b) {
$age--;
}
return($age);
}
而在搜索时却是
select ??? from table users where (to_days(now())-to_days(birth))/365 between $age and $age2
结果搜索出的年龄与实际不符,诸位有没有好的办法。谢谢。
逛论坛交流:年龄计算问题
另外说一下birth为1980-10-10形式。
先数据库里取出1980 在慢慢加减!!
呵呵,好办法,我这样用了,不过不太精确!
3 条回复
回复