PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?
if(($this !== "thing1" AND $this !== "thing2" AND $this !== "thing3")) {
print "Then do this if not equal to any of those";
}
?>
What I want to do is put "thing1" "thing2" "Thing3" into an array and check from there if possible (so I can call the variables on different pages and not have to recode each page for changes).
<?php
$array = array("thing1", "thing2", "thing3");
if (!in_array($this, $array)) {
print "Then do this if not equal to any of those";
}
?>
avatar just beat me to it, but his code will run if the value exists in the array, whilst i think you wanted to execute the code if the none of the values existed in the array.
Mark
Last edited by JayBird on Fri Jan 09, 2004 8:44 am, edited 1 time in total.