While
$w is an Array ( [0] => 4, [1] => 6 )
what does this statement mean:
$day == $w[0] || $day == $w[1] || $day < ((7 + $w[1] - $w[0]) % 7);
Please help. I have not seen the ||
operator inside other than an if or while statement. Thank you.
EDIT 01:
This is the original function where it is used to find the number of a particular day in a date range:
// find number of a particular day (sunday or monday or etc) within a date range
function number_of_days($day, $start, $end){
$w = array(date('w', $start), date('w', $end));
return floor( ( date('z', $end) - date('z', $start) ) / 7) + ($day == $w[0] || $day == $w[1] || $day < ((7 + $w[1] - $w[0]) % 7));
}
This was not created by me. But I wanted to edit this function because when the end day is a Saturday, it is taking the following Sunday into account too, which is wrong.