I have a template string like this
$myStr ="<font face=\"#3#\" size=\"6\">TEST STRING</font>";
And an array of fonts like this
$fontList = array(
0 => "ubuntumono",
1 => "opensans",
2 => "opensanscondensed",
3 => 'opensanslight',
4 => 'exo2',
5 => 'exo2light'
);
Now I want to check my string for face=\"#3#\" (3 is the index of font in $fontList)
and replace it with face=\"opensanslight\"
How can I do it with Regex & PHP? Thank you.