3
I have the same variable where it can assume two values
<?php if($adm1){
$email = '[email protected]';
}elseif( $adm1){
$email = '[email protected]';
}
How to compare the two variables as follows, if anything other than these two emails I should issue an alert
I thought as follows:
<?php if($email !='[email protected]' OR $email !='[email protected]'){
echo 'alerta aqui';
}
But even if the email falls under one of these conditions, it will always return wrong;
The fact is that I wanted to send a warning whenever the email is different from these two options.
I don’t understand what your difficulty is. You don’t know which operator is used to
OR
? You want aAND
?– Maniero
Sorry at the beginning of PHP. What I need is to compare the values where $email always takes a single value and what I need is to validate if the value it received is different from the two options I mentioned, if I send an alert.
– lima99
This you have already written in the question.
– Maniero
The question that won’t shut up,
$email
needs to be different from both values or only one of them?– rray
If only one of the values comes different should already issue the alert, I think why complicated
– lima99