1.

How Can We Know The Number Of Days Between Two Given Dates Using Php?

Answer»

Simple arithmetic:
$DATE1 = DATE('Y-m-d');
$date2 = '2006-07-01';
$DAYS = (strtotime() - strtotime()) / (60 * 60 * 24);
echo "NUMBER of days since '2006-07-01': $days";

Simple arithmetic:
$date1 = date('Y-m-d');
$date2 = '2006-07-01';
$days = (strtotime() - strtotime()) / (60 * 60 * 24);
echo "Number of days since '2006-07-01': $days";



Discussion

No Comment Found