syntax error unexpected T_BOOLEAN_OR

岁酱吖の 提交于 2019-12-25 00:40:25

问题


I'm pretty sure its probably ( or ) that is causing it maybe one too many of them.

$filechk1 = "/temp/files/" . $data[0] . ".doc";
$filechk2 = "/temp/files/" . $data[1] . ".doc";
$dirchk1 = "/temp/files/" . $batchid . "/" .$data[0] . ".doc";
$dirchk2 = "/temp/files/" . $batchid . "/" . $data[1] . ".doc";

if(is_file($filechk1) && (is_file($filechk2))) || (is_file($dirchk1) && (is_file($dirchk2))){
    ...
}

回答1:


Incorrectly placed parentheses. Needs to be this.

if ((is_file($filechk1) && is_file($filechk2)) || (is_file($dirchk1) && is_file($dirchk2)))


来源:https://stackoverflow.com/questions/4419095/syntax-error-unexpected-t-boolean-or

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!