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.
精彩评论