src/Date/Date.php
/**
	 * Count days between dates
	 * $ignore ignore day numbers like sunday = 7
	 *
	 * @param string|null $start   - null means now
	 * @param string|null $endDate - null means now
	 * @param array       $ignore
	 * @throws \Exception
	 * @return int
	 */
Count days between dates
$ignore ignore day numbers like sunday = 7


Count days between dates $ignore ignore day numbers like sunday = 7
public static function daysBetween(string $start = null, string $endDate = null, array $ignore = []): int
	{
		$result  = 0;
		$start   = self::of($start)->sqlDate();
		$endDate = self::of($endDate)->sqlDate();
		while ($start != $endDate) {
			$time = self::time($start);
			if (!in_array(strftime("%u", $time), $ignore)) {
				$result++;
			}
			$start = self::of(self::time("+1 day", $time))->sqlDate();
		}
		return $result;
	}
public static function daysBetween ( string $ start = null , string $ endDate = null , array $ ignore = [ ] ) : int { $ result = 0 ; $ start = self :: of ( $ start ) -> sqlDate ( ) ; $ endDate = self :: of ( $ endDate ) -> sqlDate ( ) ; while ( $ start != $ endDate ) { $ time = self :: time ( $ start ) ; if ( ! in_array ( strftime ( " %u " , $ time ) , $ ignore ) ) { $ result ++ ; } $ start = self :: of ( self :: time ( " +1 day " , $ time ) ) -> sqlDate ( ) ; } return $ result ; }
Count days between dates
 $ignore ignore day numbers like sunday = 7
Count days between dates $ignore ignore day numbers like sunday = 7