为什么不工作echo(函数strtotime)在这段代码?
不显示任何内容
$ok = '2011/07/18';
echo strtotime($ok);
我试了一下你的代码,效果很好。
#!/usr/bin/php
<?php
$ok = '2011/07/18';
echo strtotime($ok);
echo date("F j, Y, g:i:s a",strtotime($ok));
?>
回复:1310965200July 18, 2011, 12:00:00 am
我个人没有得到任何意想不到的东西。您是否意识到您将得到一个数字来响应strtotime
,而不是一个格式化的日期?你必须打电话给strftime
(或类似的)来格式化它。