0

I know you can use the if/elseif to make php compare values

if ( $Quantity != 0){
	 $a = ( $b * $c );
	 
		}
elseif ( $Quantity == 0){ 

$a = ( $b + $c );
	 
		}

but what if you want it to do something only if a field has no value.

if ( $Quantity != ' '){
	 $a = ( $b * $c );
	 
		}
elseif ( $Quantity == 'all other values'){ 

$a = ( $b + $c );
	 
		}
3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by zeusofolus
0

as noelthefish wrote, the elseif is redundant and takes (miniscule) resources to run, the ! means not,
If (not$variable) {do something;}
else {do something else}

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.