¿Una forma más sencilla de verificar si la variable no es igual a varios valores de cadena?
Códigos actuales:
<?php
// See the AND operator; How do I simplify/shorten this line?
if( $some_variable !== 'uk' && $some_variable !== 'in' ) {
// Do something
}
?>
Y:
<?php
// See the OR operator; How do I simplify/shorten this line?
if( $some_variable !== 'uk' || $some_variable !== 'in' ) {
// Do something else
}
?>
¿Hay una forma más simple (es decir, más corta) de escribir las dos condiciones?
NOTA: Sí, son diferentes, y estoy esperando diferentes formas de acortar los códigos.