Php calendar code sharing simple and practical php calendar code
- Header ("content-type: text/html; charset = utf-8 ");
- ?>
-
-
- /**
- * Simple and practical php calendar code
- * Edit: bbs.it-home.org
- */
- If (! Emptyempty ($ _ GET )){
- $ Year = $ _ GET ['Year'];
- $ Month = $ _ GET ['month'];
- }
- If (emptyempty ($ year )){
- $ Year = date ('Y ');
- }
- If (emptyempty ($ month )){
- $ Month = date ('M ');
- }
- $ Start_weekday = date ('W', mktime (0, 0, 0, $ month, 1, $ year ));
- // Echo $ start_weekday;
- $ Days = date ('t', mktime (0, 0, 0, $ month, 1, $ year ));
- // Echo $ days;
- $ Week = array ('Sunday', 'Monday', 'Tuesday', 'weday', 'thurs', 'Friday', 'satur ');
- $ I = 0;
- $ K = 1;
- $ J = 0;
- Echo'
- Echo'
- Echo'
- For ($ I = 0; $ I <7; $ I ++ ){
- }
- Echo'
- For ($ j = 0; $ j <$ start_weekday; $ j ++ ){
- }
- } Else {
- }
- }
- $ J ++;
-
- Echo"
- Echo"
- Echo'
- Echo"
- Echo"
- Echo'
- Echo'
- Echo'
- Echo'
- Echo'
- While ($ k <= $ days ){
- If ($ k = date ('D ')){
- Echo'
- Echo'
- If ($ j + 1) % 7 = 0 ){
- Echo'
- $ J ++;
- $ K ++;
- }
- While ($ j % 7! = 0 ){
- Echo'
- }
- Echo'
- Echo'
';
'. $ Year. 'year'. $ month. 'month '.' |
';
';
'. $ Week [$ I].' | ';
';
';
'. $ J .' | ';
'. $ K .' | ';
'. $ K .' | ';
';
'. $ J .' | ';
';
';
". '<'.' | ';
". '<'.' | ';
';- Echo '';
- Echo'
| ';
". '> '.' | ';
". '> '.' | ';
';
';
-
- Function lastYear ($ year, $ month ){
- $ Year = $ year-1;
- Return "year = $ year & month = $ month ";
- }
- Function lastMonth ($ year, $ month ){
- If ($ month = 1 ){
- $ Year = $ year-1;
- $ Month = 12;
- } Else {
- $ Month --;
- }
- Return "year = $ year & month = $ month ";
- }
- Function nextYear ($ year, $ month ){
- $ Year = $ year + 1;
- Return "year = $ year & month = $ month ";
- }
- Function nextMonth ($ year, $ month ){
- If ($ month = 12 ){
- $ Year = $ year + 1;
- $ Month = 1;
- } Else {
- $ Month ++;
- }
- Return "year = $ year & month = $ month ";
- }
- ?>
>>> Articles you may be interested in: php calender calendar code (solving 2038 issues) php calendar code (with demo effect) php calendar code php efficient calendar code php calendar code three good php calendar code share a PHP simple calendar code php simple calendar implementation code (events can be bound) |