php中計(jì)算離生日還剩下多少天?
/生日倒計(jì)時(shí)$birthday = "2017-12-29";date_default_timezone_set("PRC")
;//今天的時(shí)間戳$today = time()
;echo "今天是".date("Y-m-d",$today).""
;//生日時(shí)間戳$bstamp = strtotime($birthday)
;//倒計(jì)時(shí)多少天$rev = ceil(($bstamp-$today)/(24*3600))
;echo "距離您的生日還有".$rev."天";