What is the usage of the PHP mktime function?
The mktime() function is used to return the Unix timestamp of a date. It takes multiple parameters, including hours, minutes, seconds, month, day, and year, and returns a Unix timestamp.
Here is an example of how to use the mktime() function.
// 创建一个日期:2022年3月21日,12时0分0秒
$timestamp = mktime(12, 0, 0, 3, 21, 2022);
echo $timestamp; // 输出 Unix 时间戳
In the example above, the mktime() function takes parameters such as hours, minutes, seconds, month, day, and year, and returns the corresponding Unix timestamp.