Example for count days between 2 dates.
<?php
$start =
"20030101";
$end = "20031231";
function
check($x){
return
(strlen($x)==1?"0".$x:$x);
}
$count=0;
for($i =
$start;$i<=$end;$i++){
$year = substr($i,0,4);
$mnd =
substr($i,4,2);
$day = substr($i,6,2);
if(checkdate
($mnd,$day,$year)){
$count++;
}else{
if($mnd>12){
$mnd = "01";
$day =
"00";
$year++;
}
if($day>=31){
$day = "00";
$mnd =
check($mnd+1);
}
$i =
$year.$mnd.$day;
}
}
echo $count;
?>