I need to subtract a number of days from a date which is stored in a dynamic variable '$workdate' .
The number of days to be subtracted from the date is also generating dynamically.
$workdate=date('d/m/y', strtotime($wdate)); //$wdate is a date selected from date picker and passed from previous page.
I have a variable named '$deduc' whose value is dynamically generating. suppose $deduc=2 now I need to do:
$workdate-$deduc=?
$workdate=date('d/m/y', strtotime($wdate));
while($some_value=0)
{
$deduc=$deduc+1;
$some_value--;
}
now I need to subtract $deduc no. of days from $workdate. Please do help.