How can I make a variable that will not be less than zero? Like:
$var=(($add-$substract) || 0);
That works in JavaScript, but not in PHP. Can someone help me?
Thanks!
You could use ternary operators
$var = ($add-$subtract)>0?($add-$subtract):0;