Hi, I have a little difficulty getting this condition together...
I have a variable $var that will assume any value (characters and numbers) but that has to have a value (required) and a variable $n that also will assume any value and has to have a value (required). I need to build a condition that will do a certain thing ONLY if $var does NOT have and $n has any value that is not a number (in particular between 1 and 50). In other words if $var has any value and $n has any NUMERICAL value then it's ok but if either $var has no value or $n has a value that is NOT numberical then it is not ok.
I tried this:
if ( !$var && $n >= "1" && $n <= "50" ) {
not ok
} else {
it's ok
}
but it doesn't work.
Can somebody help me?