Another one that should be easy that I am just not finding anywhere in
the manual.
How do I put an 'and' or an 'or' in an if statement?
I know I could achieve the same results with multiple if statements,
but that seems so inefficient.
Lets say I wanted to check a bunch of fields to make sure
http://www.php.net/manual/en/language.operators.logical.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Diana,
Diana Cassady said:
Another one that should be easy that I am just not finding anywhere in
the manual.
How do I put an 'and' or an 'or' in an if statement?
I know I could achieve the same results with multiple if statements,
but that seems so inefficient.
Lets say I wanted to
Lets say I wanted to check a bunch of fields to make sure they weren't
empty. I can check one field by saying:
if ($field1) {
echo Field 1 is not empty;
}
I'd use empty() since certain values would cause your if to evalute to false
http://www.php.net/manual/en/function.empty.php