PHP获取某月有多少天某天是星期几等等

    <?php
    $t=mktime(0,0,0,'11','22','2015');
    echo date('t',$t)."<br>"; //某月有多少天
    echo date('N',$t)."<br>"; //某天是星期几

    $now = strtotime(date("Y-m-d"));
    $day = date('Y-m-d',strtotime("+30 days",$now));
    echo "30天后:".$day."<br>";
    $week = date('Y-m-d',strtotime("-1 week",$now));
    echo "1周前:".$week."<br>";
    $mon = date('Y-m-d',strtotime("11 month",$now));
    echo "11个月后:".$mon."<br>";
    ?>

    转载请注明:RAIN MAN » PHP获取某月有多少天某天是星期几等等

    喜欢 0

还没有人抢沙发呢~