开发者

problem with echo variable in function strtotime()

why not worked echo (function strtotime) in this code?

not displaying anything.

$ok 开发者_运维百科= '2011/07/18'; 
echo strtotime($ok);


I tried your code and it worked fine.

#!/usr/bin/php
<?php


$ok = '2011/07/18';
echo strtotime($ok);


echo date("F j, Y, g:i:s a",strtotime($ok));
?>

Response: 1310965200July 18, 2011, 12:00:00 am


I personally didn't get anything unexpected. Are you aware you're going to get a number in response to strtotime and not a formatted date? You'd have to make a call to strftime (or similar) to format it back.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜