String as calculation in php
<p>I've got field in my database which contain strings like <code>21;48;33;22;31</code>. Then I'd like to convert it to mathematical calculation <code>21+48+33+22+31</code>.</p>

<pre><code>$points = "21;48;33;22;31";
$points = str_replace(";","+",$points );
$points = preg_replace('/[^0-9\+\-\*\/\s]+/', '', $points);
echo $points;
</code></pre>

<p>But that simply does not work. I've got the same string "21+48+33+22+31" instead of the sum.</p>
