PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
| is bitwise operator but || is logical operator.
I also think that || should be there and tried it with some examples but amazing | also worked in the situation.
That makes me confusing too
It´s a weird way to do it , but it works fine... the ! operator cast all vars as boolean, and then the bitwise cast them as integers, so you´ll have a 1 if a var is empty (null, 0, "", "0"), and a 0 if all of them are not empty
I thought that one pipe "|" forced the if statement to check _every_ test, regardless of when a TRUE value was found, and the double pipe "||" would only evaluate the statements until the first TRUE value is found. Same with a single ampersand versus a double ampersand. So, if you have a function in you if statement that you _must_ have evaluated, use the single pipe/ampersand.