使用TP5出现错误如“... could not be converted to int”

使用TP5出现错误如“... could not be converted to int”

应该是自己写法的不严谨,自己做记录,改掉这个不好的习惯。

写操作语句,以前的遗留方式

if($result != 1){
  echo 'error';
}

这种情况下突然报错了。改为:

if(!$result){
  echo 'error';
}

谨记!!!

猜你喜欢

转载自blog.csdn.net/weixin_34185512/article/details/86878802