Re: [请益] 请教一个日期条件设计问题

楼主: lusaka (gary.lusifa)   2018-01-24 22:29:43
由于我的PHP网页的程式是5.2.9
所以先依据目前可以使用的状态写成以下算是分享一下。如果有什么可以加强的方式,
可以请先进建议
<?
$nowdate= date("Y-m-d");
$birthday = 1911-01-02;
$birthday=date("Y")."-".date("m",strtotime($birthday))."-"
.date("d",strtotime($birthday));
$birthday_s=date("Y")."-".date("m",strtotime($birthday))."-01";
$birthday1 = strtotime($birthday);
$start_Date = date("Y-m-01", strtotime ("-1 month", $birthday1));
$start_Date2= mb_substr($start_Date,0,10);
$startDate1=strtotime($start_Date);
$end_Date =date ("Y-m-d", strtotime ("+2 month -1 day", $startDate1));
?>
<?
if(($nowdate > $start_Date) && ($nowdate < $end_Date)){ //图案显示条件
?>
<!

Links booklink

Contact Us: admin [ a t ] ucptt.com