public static function secureDiv($i1, $i2)
    {
        if (is_numeric($i1) && is_numeric($i2) && floatval($i2) != 0) {
            return $i1 / $i2;
        }
        return 0;
    }
public static function secureDiv($i1, $i2)
    {
        if (is_numeric($i1) && is_numeric($i2) && floatval($i2) != 0) {
            return $i1 / $i2;
        }
        return 0;
    }
public static function secureDiv ( $ i1 , $ i2 ) { if ( is_numeric ( $ i1 ) && is_numeric ( $ i2 ) && floatval ( $ i2 ) != 0 ) { return $ i1 / $ i2 ; } return 0 ; }
Computes the division of i1 by i2. If either i1 or i2 are not number, or if i2 has a value of zero
we return 0 to avoid the division by zero.

@param number $i1
@param number $i2
@return number The result of the division or zero
Computes the division of i1 by i2 . If either i1 or i2 are not number or if i2 has a value of zero we return 0 to avoid the division by zero .