Preview:
<?php

function calculater($num1,$num1,$num2) {
if ($sum == "+"){
return $num1 + $num2;
}elseif ($sum == "-"){
return $num1 - $num2;
}elseif ($sum == "*"){
return $num1 * $num2;
}elseif ($sum == "/"){
return $num1 / $num2;
}else{
echo"not true value"
}
}

$number1 = 10;
$number2 = 20;
$sum="*";


echo calculater($number1,$number2,$sum);

?>
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter