it is easy
let say ur database table date filed is in the timestamp fromat
$Today_date=date("Y-m-d");
$D1=substr($table_date_field,0,8);
$D2=substr($Today_date,0,8);
$Date_str_one=strtotime($D1);
$Date_str_two=strtotime($D2);
$no_of_dayz= ($Date_str_two-$Date_str_one)/(3600*24);
|