Php 如何知道今天是12月31日
我希望在我的网站上显示类似问候语的内容 仅当月份和日期为12月31日或1月1日时 只需使用PHP的$today=date'm-d',以稍后查找的格式生成$today;生成数字{month}-{day},如示例代码所示Php 如何知道今天是12月31日,php,date,Php,Date,我希望在我的网站上显示类似问候语的内容 仅当月份和日期为12月31日或1月1日时 只需使用PHP的$today=date'm-d',以稍后查找的格式生成$today;生成数字{month}-{day},如示例代码所示 <?php $today = date('m-d'); if($today =='12-31' || $today =='01-01'){ echo 'Greetings.'; } echo $today; 你看过php日期函数了吗?我知道,但如何比较help
<?php
$today = date('m-d');
if($today =='12-31' || $today =='01-01'){
echo 'Greetings.';
}
echo $today;
你看过php日期函数了吗?我知道,但如何比较help pleasedate节目,如2016-12-30我只想要一个月和datedate'm-d'='12-31'哦,是的,我有多笨:
<?php
$today = date('m-d');
if($today =='12-31' || $today =='01-01'){
echo 'Greetings.';
}
echo $today;
$yearend_date = strtotime('31 Dec');
$yearEnd = date('Y-m-d', $yearend_date);
$YearStart = date('Y-m-d',strtotime('+1 day',$yearend_date));
$today = date('Y-m-d');
if($yearEnd==$today || $YearStart==$today){
echo "greetings";
}