2015/01/29”我想将这个日期转换为PHP可以理解的格式: 2015-01-29.
<?php$date变量的结构如下所示:
// (1) 返回一个 Unix 时间戳,例如 1422486000
$time = strtotime(2011/05/21”);
// (2) getDate() 返回一个数组,其中包含该时间戳的
// 信息,如果没有给出
//时间戳,则返回本地时间
$date = getDate($time);
print_r($date);
?>
Array它有效,即使它不是您可以获得的最佳结构,也至少可以获取有关日、月和当前年份的基本信息。
(
[seconds] => 0
[minutes] => 0
[hours] => 0
[mday] => 29
[wday] => 4
[my] => 1
[年] =>2015
[yday] =>28
[工作日] =>星期四
[月] =>一月
[0] =>1422486000
)
Please disable your ad blocker and refresh the window to use this website.