1、strtotime()函数的定义:
strtotime()函数是把字符串格式的日期转换成时间戳函数,可以将任何英文文本的时间描述转换成UNIX时间戳,也可以将日期字符串转化成UNIX时间戳。
2、strtotime()函数的语法
int strtotime(string $time[,int $now=time()])
参数说明:
time:必选参数,表示时间的文本描述
now:可选参数,表示计算的开始时间戳
返回值:成功返回unix时间戳,否则返回false
3、strtotime()函数的使用方式
$times=strtotime('2024-03-20 09:23:32')
echo $times;
$times2=strtotime('2024-03-20')
$times3=strtotime('today')
$times4=strtotime('tomorrow')
上一篇:
tp6发送邮件,函数的处理方式