alright, this was an interesting question, so i did a little testing. first off, you can do this two ways. first, you can extract the numerator and denominator separately and THEN run the fraction:

$components = explode('/', $_POST['fraction']);
if (count($components) > 1)
{
it's an array with $components[0] as numerator, $components[1] as denominator
}
else
{
it's just a number
}

a warning about using this method: it isn't exceptionally good at error-checking. if the user puts in more than one slash, it will only use the first and second numbers if you use $components[0] and $components[1].

otherwise, you can use the eval() function to process the $_POST['fraction'] as though it were an actual statement:

eval("\$decimal = {$_POST['fraction']};");

if $_POST['fraction'] was "2/3" for example, what eval() would run is:

$decimal = 2/3;

which is what you're after. this also takes care of the case that the number is not a fraction, since $decimal will just be assigned to the number.

hope this helps.