修复Warning: A non-numeric value encountered

图片描述:

原因
官方文档

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)
博客
32132
07-14 361
07-12 291
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值