Week Days

Tag Archives: Week Days

PHP script – how to find the working days from a specified date? 21May, 2010

PHP script – how to find the working days from a specified date?

<?php /* This is a function to find out working days from a specified date and format of date must be dd-mm-yyyy First parameter to function is the date from which working days are to be calculated (working day exclude Sun and Sat) Second parameter to function is the number of working days to be calculated */ function workingDays( $fromDate, $interval ) { $date_array = explode(‘-‘, $fromDate ); $day = $date_array[0]; $month = $date_array[1]; $year = $date_array[2]; $working_date = array(); for ( $i = 1; $i <= $interval; $i++ ) { $day_text = date(“D”, mktime( 0, 0, 0,$month,$day + (int)$i,$year)); if( $day_text == ‘Sat’ || $day_text == ‘Sun’ ) { $interval++; continue; } $working_date[] = date(“F j, Y”, if (1==1)…

Posted in: PHP