Jay Blanchard wrote:

[snip]
Before I go screwing this code up I thought I would ask for the
formatting. How would you write the following in PHP?

if $entry not equal to "Copy Change"
                        OR
                        "Banner Change"
                        OR
                        "Price Change"

AND

$row['photo_check'] not equal to ""
[/snip]

There are several ways .... here is one....

if(("" != $row['photo_check']) && (("Copy Change" != $entry) || ("Banner
Change" != $entry) || ("Price Change" != $entry)))

Note the parentheses to define preference order.



How about :

if("" != $row['photo_check'])){

switch($entry){
case "Copy Change": case "Banner Change":
case "Price Change":
break;
default:
//put your code here
}
}



Longer but seems more readable to me.

Disclaimer: I have probably left a silly typo somewhere.

/Mattias

--
http://www.thorslund.us

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to