I have the following array
static public $tabla = array(
'A'=>2, 'B'=>2, 'C'=>2,
'D'=>3, 'E'=>3, 'F'=>3,
'G'=>4, 'H'=>4, 'I'=>4,
'J'=>5, 'K'=>5, 'L'=>5,
'M'=>6, 'N'=>6, 'O'=>6,
'P'=>7, 'Q'=>7, 'R'=>7,
'S'=>8, 'T'=>8, 'U'=>8,
'V'=>9, 'W'=>9, 'X'=>9,
'Y'=>0, 'Z'=>0
);
And several strings consisting of alphanumeric characters, for example: "G20513F4561B". What is most efficient way of replacing the non-numeric characters in string by its equivalence according the given array?
I know this can be easily implemented using a loop but maybe there is some kind of regular expression that does the trick.
Thanks