PHP function count weekdays

Here is one for ya: count the amount of weekdays (mo-fr)  between a given start and end date.

function countWeekDays($start,$end){
 $d=0;if($end>$start){while($start<$end){if(date('w',$start)!=6 && date('w',$start)!=0){ $d++; }$start = strtotime('+1 day',$start);}}return $d ;
}

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word