Formatting fractions found in a given string to html fraction
Well, regex is often a bad idea, but it's one of the case I find it way better than the alternative :

$raw='30 1/2 et 22 3 / 4';
echo preg_replace('/([0-9]+)\s*\/\s*([0-9]+)/', '&lt;sup&gt;$1&lt;/sup&gt;&amp;frasl;&lt;sub&gt;$2&lt;/sub&gt;',$raw);


Just test it and see for yourself.