- Thread Starter
- #41
Code:foreach ($period as $p ) { $totalDays++; if($p->format( "w" )== 0 or $p->format( "w" )== 6 ) $weekendDays++; // $tempDate = $p->format("Y-m-d"); // if(isset($tempArray[$tempDate])){ $holiday++; } //icomment out mo muna yung 2 line sa taas //ipalit mo to echo $tempDate . ' - '; echo (isset($tempArray[$tempDate']) ? 'meron' : 'wala'; echo '<br>'; }
SEPTEMBER 24
Code:
Array
(
[2017-09-22] =>
)
DatePeriod Object
(
[start] => DateTime Object
(
[date] => 2017-09-15 00:00:00.000000
[timezone_type] => 3
[timezone] => Asia/Manila
)
[current] =>
[end] => DateTime Object
(
[date] => 2017-09-24 00:00:00.000000
[timezone_type] => 3
[timezone] => Asia/Manila
)
[interval] => DateInterval Object
(
[y] => 0
[m] => 0
[d] => 1
[h] => 0
[i] => 0
[s] => 0
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] =>
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)
[recurrences] => 1
[include_start_date] => 1
)
2017-09-15 - wala
2017-09-16 - wala
2017-09-17 - wala
2017-09-18 - wala
2017-09-19 - wala
2017-09-20 - wala
2017-09-21 - wala
2017-09-22 - meron
2017-09-23 - wala
Total days: 9
Weekend days: 3
Holidays: 0
₱ 30
SEPTEMBER 25
Code:
Array
(
[2017-09-25] =>
[2017-09-22] =>
)
DatePeriod Object
(
[start] => DateTime Object
(
[date] => 2017-09-15 00:00:00.000000
[timezone_type] => 3
[timezone] => Asia/Manila
)
[current] =>
[end] => DateTime Object
(
[date] => 2017-09-25 00:00:00.000000
[timezone_type] => 3
[timezone] => Asia/Manila
)
[interval] => DateInterval Object
(
[y] => 0
[m] => 0
[d] => 1
[h] => 0
[i] => 0
[s] => 0
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] =>
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)
[recurrences] => 1
[include_start_date] => 1
)
2017-09-15 - wala
2017-09-16 - wala
2017-09-17 - wala
2017-09-18 - wala
2017-09-19 - wala
2017-09-20 - wala
2017-09-21 - wala
2017-09-22 - meron
2017-09-23 - wala
2017-09-24 - wala
Total days: 10
Weekend days: 4
Holidays: 0
₱ 30
SEPTEMBER 26
Code:
Array
(
[2017-09-26] =>
[2017-09-25] =>
[2017-09-22] =>
)
DatePeriod Object
(
[start] => DateTime Object
(
[date] => 2017-09-15 00:00:00.000000
[timezone_type] => 3
[timezone] => Asia/Manila
)
[current] =>
[end] => DateTime Object
(
[date] => 2017-09-26 00:00:00.000000
[timezone_type] => 3
[timezone] => Asia/Manila
)
[interval] => DateInterval Object
(
[y] => 0
[m] => 0
[d] => 1
[h] => 0
[i] => 0
[s] => 0
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] =>
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)
[recurrences] => 1
[include_start_date] => 1
)
2017-09-15 - wala
2017-09-16 - wala
2017-09-17 - wala
2017-09-18 - wala
2017-09-19 - wala
2017-09-20 - wala
2017-09-21 - wala
2017-09-22 - meron
2017-09-23 - wala
2017-09-24 - wala
2017-09-25 - meron
Total days: 11
Weekend days: 4
Holidays: 0
₱ 35
SEPTEMBER 27
Code:
Array
(
[2017-09-26] =>
[2017-09-25] =>
[2017-09-22] =>
)
DatePeriod Object
(
[start] => DateTime Object
(
[date] => 2017-09-15 00:00:00.000000
[timezone_type] => 3
[timezone] => Asia/Manila
)
[current] =>
[end] => DateTime Object
(
[date] => 2017-09-27 00:00:00.000000
[timezone_type] => 3
[timezone] => Asia/Manila
)
[interval] => DateInterval Object
(
[y] => 0
[m] => 0
[d] => 1
[h] => 0
[i] => 0
[s] => 0
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] =>
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)
[recurrences] => 1
[include_start_date] => 1
)
2017-09-15 - wala
2017-09-16 - wala
2017-09-17 - wala
2017-09-18 - wala
2017-09-19 - wala
2017-09-20 - wala
2017-09-21 - wala
2017-09-22 - meron
2017-09-23 - wala
2017-09-24 - wala
2017-09-25 - meron
2017-09-26 - meron
Total days: 12
Weekend days: 4
Holidays: 0
₱ 40
Last edited: