Jump to content

creating php calendar


gish

Recommended Posts

I am creating a online calender, I found a small scripted pulled it apart to find out how it works. now i am trying to create a calender will show three months two months in advance. My problem is I can't the  date[mon] to increment up.

 

Does anyone know what I am doing wrong?

 

 

    $monthOne['mon']= $monthOne['mon']+ 1; 
    echo $monthOne['mon'];

    $monthTwo['mon']= $monthOne['mon']+ 2;
    echo $monthTwo['mon'];

 

    // current month
    $today    = getdate();
    $firstDay = getdate(mktime(0,0,0,$today['mon'],1,$today['year']));
    $lastDay  = getdate(mktime(0,0,0,$today['mon']+1,0,$today['year']));
    
    //month one
    $monthOne    = getdate();  
    $monthOne['mon']= $monthOne['mon']+ 1; 
    echo $monthOne['mon'];
    $monthOnefirstday = getdate(mktime(0,0,0,$monthOne['mon'],1,$monthOne['year']));
    $monthOnelastDay  = getdate(mktime(0,0,0,$monthOne['mon']+1,0,$monthOne['year']));
    
    //month two
    $monthTwo    = getdate();
    $monthTwo['mon']= $monthOne['mon']+ 2;
    echo $monthTwo['mon'];
    $monthTwofirstday = getdate(mktime(0,0,0,$monthTwo['mon'],1,$monthTwo['year']));
    $monthTwolastDay  = getdate(mktime(0,0,0,$monthTwo['mon']+1,0,$monthTwo['year']));

 

Gish

Link to comment
https://forums.phpfreaks.com/topic/143093-creating-php-calendar/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.