Friday 30 March 2018

php - syntax error unexpected T_BOOLEAN_OR




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))){
...

}

Answer



Incorrectly placed parentheses. Needs to be this.



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

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...