<address id="ousso"></address>
<form id="ousso"><track id="ousso"><big id="ousso"></big></track></form>
  1. php計算到指定日期還有多少天的方法

    時間:2025-11-15 07:27:26 php語言 我要投稿

    php計算到指定日期還有多少天的方法

      本文實例講述了php計算到指定日期還有多少天的方法。分享給大家供大家參考。具體如下:

      ?

      1

      2

      3

      4

      5

      6

      7

      8

      9

      10

      11

      12

      13

      14

      15

      16

      17

      18

      19

      20

      21

      22

      23

      24

      function countdays($d)

      {

      $olddate = substr($d, 4);

      $newdate = date(Y) ."".$olddate;

      $nextyear = date(Y)+1 ."".$olddate;

      if($newdate > date("Y-m-d"))

      {

      $start_ts = strtotime($newdate);

      $end_ts = strtotime(date("Y-m-d"));

      $diff = $end_ts - $start_ts;

      $n = round($diff / 86400);

      $return = substr($n, 1);

      return $return;

      }

      else

      {

      $start_ts = strtotime($nextyear);

      $end_ts = strtotime(date("Y-m-d"));

      $diff = $end_ts - $start_ts;

      $n = round($diff / 86400);

      $return = substr($n, 1);

      return $return;

      }

      }

    【php計算到指定日期還有多少天的方法】相關文章:

    php日期轉時間戳 指定日期轉換成時間戳01-23

    php查找指定目錄下指定大小文件的方法09-11

    關于PHP的日期與時間11-08

    php中date()日期時間函數使用方法03-12

    PHP日期函數date格式化UNIX時間的方法01-18

    轉換中文日期的PHP程序12-14

    php如何獲取指定地區天氣02-09

    php時間戳與日期的轉換09-03

    PHP時間和日期函數詳解03-02

    • 相關推薦
    <address id="ousso"></address>
    <form id="ousso"><track id="ousso"><big id="ousso"></big></track></form>
    1. 日日做夜狠狠爱欧美黑人