简单的万年历函数
//前几天需要个万年历函数,在oso上看了个万年历,程序功能到是强大,只不过太繁琐。
//不合自己的要求,因此就自己写了一个,还可以给日期加上连接!
function calendar($year,$moon){
$moon1=array("01","02","03","04","05","06","07","08","09","10","11","12");
$moon2=array("31","28","31","30","31","30","31","31","30","31","30","31");
if(($year-2000)%4==0){$moon2[1]=29;}
for($i=0;$iif($moon1[$i]==$moon){
$total=$moon2[$i];
}
}
$out_chat="";
$out_chat.="日一二三四五六";
for($i=1;$i$j=$i;
if($i$j="0".$i;
}
$time_array=getdate(mktime(0,0,0,$moon,$j,$year));
if($i==1){
switch($time_array[wday]){
case "0":
$out_chat.="".$i."";
break;
case "1":
$out_chat.=" ".$i."";
break;
case "2":
$out_chat.=" ".$i."";
break;
case "3":
$out_chat.=" ".$i."";
break;
case "4":
$out_chat.=" ".$i."";
break;
case "5":
$out_chat.=" ".$i."";
break;
case "6":
$out_chat.=" ".$i."";
break;
}
}else{
if($i!=$total){
if($time_array[wday]!=0){
$out_chat.="".$i."";
}else{
$out_chat.="".$i."";
}
}elseif($i==$total){
switch($time_array[wday]){
case "0":
$out_chat.="".$i." ";
break;
case "1":
$out_chat.="".$i." ";
break;
case "2":
$out_chat.="".$i." ";
break;
case "3":
$out_chat.="".$i." ";
break;
case "4":
$out_chat.="".$i." ";
break;
case "5":
$out_chat.="".$i." ";
break;
case "6":
$out_chat.="".$i."";
break;
}
}
}
}
$out_chat.="";
return $out_chat;
}
$year=2000;
$moon=08;
$test=calendar($year,$moon);
echo $test;
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Is the clock app missing from your phone? The date and time will still appear on your iPhone's status bar. However, without the Clock app, you won’t be able to use world clock, stopwatch, alarm clock, and many other features. Therefore, fixing missing clock app should be at the top of your to-do list. These solutions can help you resolve this issue. Fix 1 – Place the Clock App If you mistakenly removed the Clock app from your home screen, you can put the Clock app back in its place. Step 1 – Unlock your iPhone and start swiping to the left until you reach the App Library page. Step 2 – Next, search for “clock” in the search box. Step 3 – When you see “Clock” below in the search results, press and hold it and

Are you getting "Unable to allow access to camera and microphone" when trying to use the app? Typically, you grant camera and microphone permissions to specific people on a need-to-provide basis. However, if you deny permission, the camera and microphone will not work and will display this error message instead. Solving this problem is very basic and you can do it in a minute or two. Fix 1 – Provide Camera, Microphone Permissions You can provide the necessary camera and microphone permissions directly in settings. Step 1 – Go to the Settings tab. Step 2 – Open the Privacy & Security panel. Step 3 – Turn on the “Camera” permission there. Step 4 – Inside, you will find a list of apps that have requested permission for your phone’s camera. Step 5 – Open the “Camera” of the specified app

Go language provides two dynamic function creation technologies: closure and reflection. closures allow access to variables within the closure scope, and reflection can create new functions using the FuncOf function. These technologies are useful in customizing HTTP routers, implementing highly customizable systems, and building pluggable components.

In C++ function naming, it is crucial to consider parameter order to improve readability, reduce errors, and facilitate refactoring. Common parameter order conventions include: action-object, object-action, semantic meaning, and standard library compliance. The optimal order depends on the purpose of the function, parameter types, potential confusion, and language conventions.

The key to writing efficient and maintainable Java functions is: keep it simple. Use meaningful naming. Handle special situations. Use appropriate visibility.

1. The SUM function is used to sum the numbers in a column or a group of cells, for example: =SUM(A1:J10). 2. The AVERAGE function is used to calculate the average of the numbers in a column or a group of cells, for example: =AVERAGE(A1:A10). 3. COUNT function, used to count the number of numbers or text in a column or a group of cells, for example: =COUNT(A1:A10) 4. IF function, used to make logical judgments based on specified conditions and return the corresponding result.

The advantages of default parameters in C++ functions include simplifying calls, enhancing readability, and avoiding errors. The disadvantages are limited flexibility and naming restrictions. Advantages of variadic parameters include unlimited flexibility and dynamic binding. Disadvantages include greater complexity, implicit type conversions, and difficulty in debugging.

The benefits of functions returning reference types in C++ include: Performance improvements: Passing by reference avoids object copying, thus saving memory and time. Direct modification: The caller can directly modify the returned reference object without reassigning it. Code simplicity: Passing by reference simplifies the code and requires no additional assignment operations.
