I have this very simple piece of code that calculates the number of days between to given timestamps:
$timestamp1 = strtotime("2017-01-01");
$timestamp2 = strtotime("2017-01-05");
$timeDiff = abs($timestamp1 - $timestamp2);
$numberDays = $timeDiff/86400;
$numberDays = intval($numberDays);
It is working perfectly, but I am wondering if there is a way to exclude weekends in the calculation.
I have looked around online and found some alternative options but there is alot more code than what I have above so I am asking if there is an option with minimal code like my above example?