I want to subscript every digits from string.
For example :
$str = '1Department of Chemistry, College of 2Education for Pure Science';
Output I want:
<sub>1</sub>Department of Chemistry, College of <sub>2<sub>Education for Pure Science
I fetched all digits from a string :
//digits from string
preg_match_all('!\d+!', $str, $matches);
print_r($matches);
But how can i apply subscript effect to digits and print string ?