math - How to split a longer formula into multiple lines with PHP? -
i have more complicated formulas php. cool if split formula multiple lines. know how strings, have no idea how within 1 single calculation.
i want like:
public function example_calc(){ $result = $var1 * $var2 + + $var3 * $var4 - - $var5 / $var6; return $result; }
don't duplicate +
, -
signs across lines, split normally
public function example_calc(){ $result = $var1 * $var2 + $var3 * $var4 - $var5 / $var6; return $result; }
or
public function example_calc(){ $result = $var1 * $var2 + $var3 * $var4 - $var5 / $var6; return $result; }
and cool work
it's ;
marks end of "line" of code, not carriage return/line feed
Comments
Post a Comment