警告:在第95行的C:\XAMPP\htdocs\mysites\nametestclonescript\includes\core.php中遇到非数字值
我的代码有这个错误 警告:在中遇到非数字值 C:\XAMPP\htdocs\mysites\namescript\includes\core.php在线 九十五 这是显示错误的代码警告:在第95行的C:\XAMPP\htdocs\mysites\nametestclonescript\includes\core.php中遇到非数字值,php,warnings,Php,Warnings,我的代码有这个错误 警告:在中遇到非数字值 C:\XAMPP\htdocs\mysites\namescript\includes\core.php在线 九十五 这是显示错误的代码 95. $Test['time'] = time() - $Test['time']; 96. if($LIMIT != 3){ 97. $LIMIT++; 98.
95. $Test['time'] = time() - $Test['time'];
96. if($LIMIT != 3){
97. $LIMIT++;
98. }else{
99. if($Test['time'] > 86400){
100. $Is_New = false;
101. }
102. }
我正在使用PHP7.1。有人能帮我解决这个错误而不删除该行吗。我是php初学者。
谢谢尝试将$Test['time']强制转换为int,如果$Test['time']为空或非数字,它将返回0:
$Test['time'] = time() - ((int)$Test['time']);
$Test['time'中有什么内容?把它扔了。