tracknut is mostly correct.
strpos() won't ever return an explicit TRUE. It will be FALSE or a number. So, your conditions should look more like this:
PHP Code:
$needle = strpos($string, "123");
$needle2 = strpos($string, "def");
if ($needle !== false || $needle2 !== false) {
echo "string contains either 123 or abc";
} else {
echo "string does NOT contain either 123 or abc";
}
You want to test for explicit, "!==", not false because with PHP's loose type conversion if the substring position is 0(at the beginning of the string) it will evaluate to false with "!=" and your result will be incorrect.