php时间问题 各位大大,$date2=date('d/m/Y'); 得到当前年月日。如果今天是3月26号,那么三个月的期限就是6月26号。(不论一个月30还是31天,按照月算)1,怎样写可以算出三个月是多少天呢?2,如果得到天数以后,$XXXX=天数, 每过一天,天数就自动减去一天,请问如何写呢?谢谢各位 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?php $startdate=strtotime(date("Y-m-d"));$enddate=strtotime(date("Y-m-d",strtotime(" +3 month")));$days=round(($enddate-$startdate)/3600/24) ;echo $days; //days为得到的天数;?> 上面没写好 <?php $startdate=strtotime("2010-3-26"); //开始日期$enddate=strtotime("2010-6-26"); //结束日期$days=round(($enddate-$startdate)/3600/24) ; //开始到结束一共有几天$date=strtotime(date("Y-m-d")); //今天$d=round(($date-$startdate)/3600/24) ; //开始日期到今天一共有几天echo $days -$d; //?> 楼上的大大这些代码之前 要先知道今天的日期呀 $startdate=strtotime("2010-3-26"); 这不是自动查今天的日期呀 查到今天的日期后, 要自动算出三个月后结束的那一天是几月几号,然后算出三个月是多少天然后每过一天,总数就减一天。举个例子,就像倒计时一样。期限是三个月。过一天就减一天。谢谢 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><?php$end=strtotime("2010-4-26");$start=strtotime(date("Y-m-d")); $n=ceil(($end-$start)/(60*60*24));echo "离 2010-4-26 还有 $n 天";?> 楼上的各位,$xxxxxx=26/03/2010怎样写才能让$yyyyyy=$xxxxxx+三个月呀也就是让$yyyyyy=26/06/2010谢谢各位 基础小问题,双引号字符串里面能不能表达常量? 在HTML中嵌入PHP语句.不显示打印信息. 菜鸟zend studio的使用问题!the selection did not contain any resources........ php 变量的问题 请教一个session问题 请问如何分析一个大型程序 php程序显示图片的问题,高分求教 HTTP 错误 404.17 - Not Found 请求的内容似乎是脚本,因而将无法由静态文件处理程序来处理。 关于unlink,请问这个情况是什么原因啊? 谁能教我用php和mysql做这样的页面,有偿 php时间 找个师傅指导php
<?php
$startdate=strtotime(date("Y-m-d"));
$enddate=strtotime(date("Y-m-d",strtotime(" +3 month")));
$days=round(($enddate-$startdate)/3600/24) ;
echo $days; //days为得到的天数;
?>
$startdate=strtotime("2010-3-26"); //开始日期
$enddate=strtotime("2010-6-26"); //结束日期
$days=round(($enddate-$startdate)/3600/24) ; //开始到结束一共有几天$date=strtotime(date("Y-m-d")); //今天
$d=round(($date-$startdate)/3600/24) ; //开始日期到今天一共有几天echo $days -$d; //
?>
举个例子,就像倒计时一样。期限是三个月。过一天就减一天。谢谢
<?php
$end=strtotime("2010-4-26");
$start=strtotime(date("Y-m-d"));
$n=ceil(($end-$start)/(60*60*24));
echo "离 2010-4-26 还有 $n 天";
?>
$xxxxxx=26/03/2010怎样写才能让$yyyyyy=$xxxxxx+三个月呀
也就是让$yyyyyy=26/06/2010谢谢各位