If statement that does subtraction but no equal sign?

for example

blah blah blah blah some code
 }```

I know 

```if($variable)```

means if that variable some variable exists, but this is the first time I've encountered subtraction with no equal sign..

In short, I would not recommend doing this :smile:

The code is not easily read/understood and is prone for errors you don’t expect depending on the value of the two variables.

I assume what the code actually does, is that as long as there is a positive value after the subtraction it should process the code inside the if sentence, i.e. 3 - 1 would initiate the if process, 1 - 2 would not.

ok. Thanks!

is the same as

if(0 != $variable_one - variable_two){

0 gets converted to false while any other number gets converted to true

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.