Friday, April 28, 2006

PHP Script for genarate a calender

$cellWidth = 25;
$cellHeight = 25;
$month = 4;
$year = 2006;
$dateNames[1] = "Sun";
$dateNames[2] = "Mon";
$dateNames[3] = "Tue";
$dateNames[4] = "Wed";
$dateNames[5] = "Thr";
$dateNames[6] = "Fri";
$dateNames[7] = "Sat";
$firstDate = mktime(0,0,0,$month,1,$year); // time Stamp
$lastDate = mktime(0,0,0,$month + 1, 0,$year); // time Stamp
$currentDate = mktime(0,0,0,$month,1-date('w',$firstDate),$year); // time Stamp
    echo ""; 
    echo " "; 
    echo "".date('F',$firstDate)." $year"; 
    echo ""; 
    for($i=0;$i<7;$i++){
        echo " "; 
        for($j=1;$j<=7;$j++) {
            if(!$i) { echo "$dateNames[$j]"; } 
            else { 
                echo"".date('j',$currentDate).""; 
                $currentDate = mktime(0,0,0,date('n',$currentDate),
                    date('j',$currentDate)+1,date("Y",$currentDate)); 
            } 
        }
        echo ""; 
    }
    echo "";

1 comment:

sampath said...
This comment has been removed by a blog administrator.

iPhone Launch Screen Sizes

iPhone Portrait iOS 8 Retina HT 5.5 = 1242 X 2208 Retna HD 4.7 = 750 X 1134 iPhone Landscape iOS 8 Retina HD 5.5  2208 X 1242 iPho...