Share The php code of Bay's growth progress. The main function is to display the size of Beibei based on Beibei's date of birth, and display Beibei's growth in real time. The current time is used to subtract the date of birth, but it can be displayed as a few years old. The main functions are to display the current size of Bay based on the date of birth, and to display the growth of Bay in real time.
The current time is used to subtract the date of birth, but The Age, months, and days are displayed.
The daily algorithm is a bit problematic, not considering the size of the month and February.
The code is as follows:
Function getDays (){
Putenv ("TZ = Asia/Chongqing ");
$ By = 2006;
$ Bm = 7;
$ Bd = 7;
$ Rday = "";
$ Today = getdate ();
$ By = $ today [year]-$;
$ Bm = $ today [mon]-$ bm;
$ Bd = $ today [mday]-$ bd;
If ($ bd <0 ){
$ Bd = 30 + $ bd;
$ Bm --;
}
If ($ bm <0 ){
$ Bm = 12 + $ bm;
$ --;
}
# Print $ by. "-". $ bm. "-". $ bd;
If ($ by> 0 ){
$ Rday = $ by. "years old ";
}
If ($ bm = 0 & $ bd = 0 ){
$ Rday. = "birthday ";
} Else {
If ($ bm = 0 ){
$ Rday. = "0". $ bd. "day ";
} Elseif ($ bd = 0 ){
$ Rday. = $ bm. "months ";
} Else {
$ Rday. = $ bm. "month". $ bd. "day ";
}
}
Return $ rday;
}
Directly
The code is as follows:
You can.
Leave it empty and then complete the following, and then write a js version.
Bytes. The current time is used to subtract the date of birth, but it can be displayed as the age, number of years...