脚本宝典收集整理的这篇文章主要介绍了php report-严格标准:mktime():你应该使用time()函数,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我没有写报告它使用Mktime我最近搬到了一个新的服务器与最新版本的PHP我现在得到
这是日期变量的创建:
$start_date = mktime(0,$startMonth,$startDay,$startYear); $end_date = mktime(23,59,$EndMonth,$EndDay,$EndYear);
后来得到日期:
if ($HTTP_SERVER_VARS['REQUEST_METHOD'] == "POST") { if ($PRefix == "Start") { $currYear = $startYear; $currMonth = $startMonth; $currDay = $startDay; } elseif ($prefix == "End") { $currYear = $EndYear; $currMonth = $EndMonth; $currDay = $EndDay; } } else { $arr = getdate(mktime()); $currYear = $arr["year"]; $currMonth = $arr["mon"]; // If the user hasn't chosen a date,// set the beginning day at the First of the month if ($prefix == "Start") $currDay = 01; else $currDay = $arr["mday"]; }
int mktime ([ int $hour = date("H") [,int $minute = date("i") [,int $second = date("s") [,int $month = date("n") [,int $day = date("j") [,int $year = date("Y") [,int $is_dst = -1 ]]]]]]] )
换句话说,不使用参数与使用当前日期相同,这是time()的作用.
$PHP -a Interactive shell PHP > echo mktime(); Strict Standards: mktime(): You should be using the time() function instead in PHP shell code on line 1 1450208188 PHP > echo time(); 1450208189 PHP >
如果因为你将mktime()更改为time()而导致某些事情发生了变化,那么还会发生其他事情.
以上是脚本宝典为你收集整理的php report-严格标准:mktime():你应该使用time()函数全部内容,希望文章能够帮你解决php report-严格标准:mktime():你应该使用time()函数所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。