Here is a quick example, what we'll do first is get rid of everything that isn't a number or a decimal:
$value = ereg_replace("[0-9.]", "", $value);
ok, now if they entered 2,321,200.00 we have what we really want: 2321200.00.
Now, we want to make sure we have some numbers (how many? Just one or more, don't care) a decimal, and two more numbers.
if (ereg("([0-9]).([0-9]{2})$", $value))
echo "Value is OK!";
else
echo "Value is in incorrect form.";
It breaks down to this:
([0-9]) means match numbers, any amount of numbers.
then we have ., which means we want a period (escaped because it has a special function in regular expressions). Then we have ([0-9]{2}) which again means match any numbers 0-9, but the {2} means match ONLY two characters. For reference, it could also be in the form {x, y} where x and y are the range it could fall into ({1, 9} means match this expression 1 time, 9 times, or anything in between). Finally, to make sure that we don't have anything trailing, the $ means match the end of the string. Hope that helps!
Chris King