usiing this code the output is 4, because of the from date to date range which is correct.

BUt I need to count only the date which is from Monday to Saturday or should I say don't count date which is Sunday..

Is it possible?How?

Thank you so much

Cups
—
2012-03-07T09:34:25Z —
#2

It is possible but I do not have time to solve it for you.

The thing to do is to loop through dates starting with DATE_LEAVE_FROM and keep adding one day until you find that you reach DATE_LEAVE_TO.

In that loop you would do 2 other things:

add one day to a counterif day of week is Sunday then skip that step

You'd likely wrap that in a function you could use elsewhere.

You could either use PHPs DateTime class (be very careful to check which functionality applies to your PHP version) or carry on using strtotime() with args like "+ 1 DAY" to keep moving the dates up by one.