Skip to content
Advertisement

Php Or operator doesn´works propertly [closed]

I´m trying to use or operator in a php sentence but only validate the first condition, what´s wrong?

JavaScript

Advertisement

Answer

You should invert the condition in this way:

JavaScript

Because otherwise if the user_id is 4 it will otherwise fail if it doesn’t have the role expected

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement