【发布时间】:2017-08-07 16:22:35
【问题描述】:
我犯了这个错误
已弃用:函数 split() 在
list($hrs,$mins,$secs,$msecs) = split(':',$currenttime);中已弃用
如何改写
date_default_timezone_set('US/Eastern');
$currenttime = date('h:i:s A',strtotime($row["orc15"]));
list($hrs,$mins,$secs,$msecs) = split(':',$currenttime);
$tha = date('h:i:s A',strtotime($row["orc15"]." -3 hours"));
【问题讨论】:
-
split的替代方案列在文档中:php.net/split -
你阅读了PHP手册页for split()然后看红框中提到的ALTERNATIVES
-
或者后面的TIPS同页
split() is deprecated as of PHP 5.3.0. preg_split() is the suggested alternative to this function. If you don't require the power of regular expressions, it is faster to use explode(), which doesn't incur the overhead of the regular expression engine.
标签: php