search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

Home PHP Libraries Other libraries PHP small calendar class library
PHP small calendar class library
<?php
// file:calendar.class.php 日历类原文件
error_reporting(0);
class Calendar{
  private $year;
  private $month;
  private $start_weekday; //当月的第一天对应的是周几,作为当月开始遍历日期的开始
  private $days; //当前月总天数
//构造方法,用来初使化一些日期属性
  function __construct(){
//如果用户没有设置所份数,则使用当前系统时间的年份
    $this->year = isset($_GET["year"]) ? $_GET["year"] : date("Y");
//如果用户没有设置月份数,则使用当前系统时间的月份
    $this->month = isset($_GET["month"]) ? $_GET["month"] : date("m");
//通过具体的年份和月份,利用date()函数的w参数获取当月第一天对应的是周几
    $this->start_weekday = date("w",mktime(0,0,0,$this->month,1,$this->year));
//通过具体的年份和月份,利用date()函数的t参数获取当月的天数
    $this->days = date("t",mktime(0,0,0,$this->month,1,$this->year));
  }

Calendar is a daily-use publication used to record dates and other related information. One that displays information for one day on each page is called a calendar, one that displays information for one month on each page is called a monthly calendar, and one that displays information for a whole year on each page is called an annual calendar. There are many forms, such as wall calendars, desk calendars, annual calendar cards, etc., and now there are electronic calendars.

China first had a calendar about four thousand years ago. According to a page of the oracle bone calendar in the oracle bone inscriptions, it is proved that the calendar of the Yin Dynasty has reached a considerable level. This page of the oracle bone calendar is the oldest physical almanac in all mankind. This page of the oracle bone calendar is also called a calendar.


Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: [email protected]

How to enable Pico.css on demand in a project without polluting styles globally How to enable Pico.css on demand in a project without polluting styles globally

09 Feb 2026

Pico.css has provided the pico.conditional.min.css version since v2, which only takes effect on elements with class="pico" added, completely solving the problem of style conflicts with other UI libraries.

What is the difference between mysql full database recovery and single database recovery_mysql operation method instructions What is the difference between mysql full database recovery and single database recovery_mysql operation method instructions

09 Feb 2026

Full database recovery is to directly import the SQL file generated by mysqldump--all-databases, covering all libraries (including system libraries). The risk is high, but it is suitable for the entire instance crash; you must check the CREATEDATABASE statement, target library list and character set, SQL mode, permission library synchronization and other details.

How to secure your MySQL server? (Security Hardening Checklist) How to secure your MySQL server? (Security Hardening Checklist)

26 Feb 2026

MySQL security hardening requires disabling anonymous users and test libraries, restricting root remote login and creating dedicated management accounts, forcing TLS encryption, closing local_infile and other dangerous functions, and regularly checking key security variables.

How to use the filter_var function for validation in PHP? How to use the filter_var function for validation in PHP?

09 Nov 2025

The filter_var() function is used to verify and clean data. It supports email, integer, URL, IP and other format verification. It is implemented through built-in filters such as FILTER_VALIDATE_EMAIL without the need for external libraries.

How to correctly load JARs with embedded dependencies (such as 'fat JARs') in Java applications How to correctly load JARs with embedded dependencies (such as 'fat JARs') in Java applications

10 Feb 2026

This article explains in detail why the "fat JAR" containing the libs/ directory cannot be directly loaded as a normal dependency, and the standardized practice plan for safely introducing external libraries in SpringBoot, Tomcat and other environments.

Best way to keep unparsed JSON fields in Go Best way to keep unparsed JSON fields in Go

01 Jan 2026

This article discusses how to decode some fields into a structure while retaining other fields not defined in the structure when using the encoding/json package to process JSON data in the Go language. We will introduce methods using the json.RawMessage type and custom Unmarshaler/Marshaler interfaces, and briefly mention solutions from other libraries to help developers flexibly handle dynamic JSON data.

Show More