how can I do this?
$v1=105;
$v2=90;
if ($value=='subtraction'){
$operator='-';
}else{
$operator='+';
}
$new_value=$v1.$operator.$v2;
So it should return 105-90=15 or 105+90=195. But how can I use the $operator variable as a operator? For example this doesn't work:
eval("$new_value=$v1".$operator."$v2");
Thanks for the help!