I want to store a plus sign (or any other sign) in a PHP variable and make arithmetic operation. I tried to store sign plus in variable $c. But PHP it's not accepting it.
$a = 3;
$b = 5;
$с = "+";
But when I echo it,
echo $a. $c. $b;
it gives me the result 35.
I tried enothoer one way, but it doesn't work:
if ($c === "+"){
echo $a + $b;}
else {
echo $a - $b;}
The result is -2. How get result $a + $b?