I need to set up a variable that is
$yesterday = $mday - 1 (being $mday the month day between 1-31)
this is problemless if the $mday is between 2 and 32 ... but when $mday = 1 I get $yesterday = 0 !
well ... that's not true
Finding out when $yesterday = 31 or 30 is kind of easy too
But when it is 29 or 28 ? this one is crashing my brain.
My solution so far ...
list($wday,$mday,$month,$year,$hour,$minutes) = split("( )",date("w j n Y H i"));
$yesterday = $mday-1;
if($yesterday == "0"){
if($month=="12" || $month == "10" || $month=="7" || $month == "5"){
$yesterday = "30";
}
elseif($month=="1" || $month=="2" || $month=="4" || $month=="6" || $month=="8" || $month=="9" || $month=="11" ||){
$yesterday = "31";
}
else{
????????????????????????????
????????????????????????????
????????????????????????????
}
}
