各位大家好,我想获得当前的约会对象.
这是我试过的:
<?php
$transdate = date('m-d-Y', time());
echo $transdate;
$month = date('m', strtotime($transdate));
if($month == "12"){
echo "<br />December is the month :)";
} else {
echo "<br /> The month is probably not December";
}
?>
Run Code Online (Sandbox Code Playgroud)
但结果是错误的,它应该显示12月是月份:0
有任何想法吗?谢谢.
Ani*_*ena 10
这段代码对你有用
<?php
$month = date('m');
if($month == 12){
echo "<br />December is the month :)";
} else {
echo "<br /> The month is probably not December";
}
?>
Run Code Online (Sandbox Code Playgroud)