-2

订阅到期后,我怎样才能找回天数?

我的数据库中有“vipudlob”。它是时间戳。提前2个月。?

<?php
$expire = strtotime("+2 months", time());
$daysback = $expire-time();
echo $daysback%3600;
?>
4

1 回答 1

0

你可以试试

$datetime1 = new DateTime();
$datetime2 = new DateTime("+2 months");
$interval = $datetime1->diff($datetime2);
echo $interval->format('%R%a days');

输出

+61 days
于 2012-10-09T08:05:34.340 回答