Example:
$number = "50";
//I am simulating the creation of this $variable since this is the value that it gives me in a real server
$variable = "0 - 10"; //$variable must go like this with quotes
$result = $number + $variable; //50 + 0 - 10 expect
echo $result;
//i need result 40
As you can see in the example I need to use the string generated by $variable to use it in a mathematical operation.