How to turn a vulgar fraction into something PHP can use to compute the value of.
For example ¾
$l = \'¾\';
echo utf8_encode($l) . \' :: \' .ord($l) .
You could use iconv() to transliterate the symbol into a form that can then be easily parsed:
function utf8FractionToFloat($symbol)
{
$translit = trim(iconv('UTF-8', 'ASCII//TRANSLIT', $symbol));
if ($translit && preg_match('~^(\d+)/(\d+)$~', $translit, $match)) {
return $match[1] / $match[2];
}
}
var_dump(utf8FractionToFloat('½')); // float(0.5)
var_dump(utf8FractionToFloat('¾')); // float(0.75)