Announcement

Collapse
No announcement yet.

php validating stuff?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • php validating stuff?

    I want a variable to = only one of the following

    $var=="a";
    $var=="b";
    $var=="c";

    But I don't think this code would work:
    Code:
    if ($var!="a"||$var!="b"||$var!="c") {
    dosomething();
    } else {
    dosthingelse();
    }
    so how would I have to do it?
    Code:
    if ($var!="a" && $var!="b" && $var!="c") {
    dosomething();
    } else {
    dosthingelse();
    }
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X