PHP preg_replace Calculation Not working
<p>I am trying to create a hook, so that when the following is found within text:</p>

<pre><code>level,2
</code></pre>

<p>It replaces it with <code>$skill_level * $n</code>, with the number after the comma being <code>$n</code></p>

<p>Here is what I have:</p>

<pre><code>$skill_level = 2;

$row['s_effect'] = "Long string of text that contains level,2."

preg_replace("/level,$n/",$skill_level * $n,$row['s_effect'])
</code></pre>

<p>I am getting a result of: </p>

<pre><code>Long string of text that contains 02.
</code></pre>

<p>I want a result of: </p>

<pre><code>Long string of text that contains 4.
</code></pre>

<p>For some reason it seems the calculation <code>"$skill_level * $n" (2 * 2)</code> is not working.</p>
