修复Warning: A non-numeric value encountered

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/c332030/article/details/88984568

图片描述:

原因
官方文档

New E_WARNING and E_NOTICE errors have been introduced when invalid strings are coerced using operators expecting numbers (+ – * / ** % << >> | & ^) or their assignment equivalents. An E_NOTICE is emitted when the string begins with a numeric value but contains trailing non-numeric characters, and an E_WARNING is emitted when the string does not contain a numeric value.

译:

在使用(+ – * / ** % << >> | & ^) 进行运算时,例如$a+$b,如果变量$a是以一个数字值开头,但包含非数字字符,例如(123d);或变量$b不是以数字值开头时,例如(b456),就会有A non-numeric value encountered警告。

解决办法:
– vim打开functions.php
– 修改$daysago = date( "Y-m-d H:i:s", strtotime($today) - ($days * 24 * 60 * 60) );$daysago = date( "Y-m-d H:i:s", strtotime($today) - (intval($days) * 24 * 60 * 60) );


参考资料:https://blog.csdn.net/fdipzone/article/details/78659784

转载请注明:大魔王ISDevil's Blog » 修复Warning: A non-numeric value encountered

喜欢 (0)

猜你喜欢

转载自blog.csdn.net/c332030/article/details/88984568