PHP: Assign and use a variable in "if" with "&&"