Page 1 of 1

Basic syntax question

Posted: Tue Oct 27, 2009 12:43 pm
by letoii
is there a shorter way to write this:

if (($curZip != '') && ($curFirst != '') && ($curLast != '')) {
}

Re: Basic syntax question

Posted: Tue Oct 27, 2009 1:44 pm
by requinix
Not really, no.

Re: Basic syntax question

Posted: Tue Oct 27, 2009 1:54 pm
by pickle
You can take the parentheses off around the comparitors:

Code: Select all

if ($curZip != '' && $curFirst != ') && $curLast != '')
but as far as logic is concerned, that can't be compressed.