Replace chars in string with array value
<p>I have the following array</p>

<pre><code>static public $tabla = array(
            'A'=&gt;2, 'B'=&gt;2, 'C'=&gt;2,
            'D'=&gt;3, 'E'=&gt;3, 'F'=&gt;3,
            'G'=&gt;4, 'H'=&gt;4, 'I'=&gt;4,
            'J'=&gt;5, 'K'=&gt;5, 'L'=&gt;5,
            'M'=&gt;6, 'N'=&gt;6, 'O'=&gt;6,
            'P'=&gt;7, 'Q'=&gt;7, 'R'=&gt;7,
            'S'=&gt;8, 'T'=&gt;8, 'U'=&gt;8,
            'V'=&gt;9, 'W'=&gt;9, 'X'=&gt;9,
            'Y'=&gt;0, 'Z'=&gt;0
            );
</code></pre>

<p>And several strings consisting of alphanumeric characters, for example: "<strong>G20513F4561B</strong>".
What is most efficient way of replacing the non-numeric characters in string by its equivalence according the given array?</p>

<p>I know this can be easily implemented using a loop but maybe there is some kind of regular expression that does the trick.</p>

<p>Thanks</p>
