$value=20; if ($divisor!=0){ #so long as the $divisor isn't equal to 0 $value=$value/$divisor; #go ahead and divide $value by $divisor } else { $divisor=1; #otherwise set $divisor to 1 }