-1
Good afternoon, I’m new in php, and I’m doing some exercises, but I’m not able to do an exercise that ask to do sum, division, multiplication or subtraction depending on the values entered in $_GET, but using elseif? I leave an image of the exercise, because they are two points, the first part already made, the second I’m not understanding how to do!
Please edit your question by including the code you’ve already developed for question 1 so we can assist you.
– Bruno Bermann
Just as you send the numbers, will send the operator by url($_GET) and apply the correct operation. ex:
if($operacao == '+'){ echo $a + $b;}
, remember to treat division by zero.– rray
Related/almost duplicate: Calculator in php
– rray