marcnyc wrote:I noticed that it works
Actually, no, it doesn't work in the sense that it means anything. This:
if ($var == 'str1'||'str2')
will always evaluate to true as long as 'str2' isn't an empty string (or a single zero). What that says is if $var equals 'str1', or if 'str2' and PHP treats any non-empty non-zero string as boolean true.
If you have more than two comparisons, you could shorten the syntax a bit by using [man]in_array/man like so:
if(in_array($var, array('var1', 'var2', 'var3', 'etc.')))