// acceptable: 1, 1.0, 1.23
// not acceptable 1.234

if (preg_match('/^[0-9]+(?:\.[0-9]{0,2})?$/', $input))
{
  print "Amount is valid";
}
else
{
  print "Amount is not valid<fish>";
}