I am developing a web application which revolves around dates.
I need to calculate numbers based around days elasped, for example - pseudo code
$coun
Of course there is a way :-)
The days that have been elapsed is simply
$elapsed_days = floor(($finish_date-$start_date) / 86400);
This will not get the result you need. What you could do is the following (pesudo)code:
$elapsed_days = floor(($finish_date-$start_date) / 86400);
for(int $i=0;$i<$elapsed_days;$i++){
$act_day_name = strtolower(date('l',$start_date+$i*86400));
if(in_array($act_day_name,$count_only){
// found matching day
}
}
What I do: I iterate over every day which is between the both dates, get the day-name with date('l'); and check if it's within the array. There may be some fine tuning need to be done, but this should get you going.