PHP Code:
if (!atLeastTwo($values))
{
die('You Must fill in at least two fields before calculating'):
}
Note the ! (right now it will stop when there at least two values, when you want the opposite instead).
Just to clarify this comment "//we check to see if the user has filled in at least two variables" - nothing actually happens here yet. It is just the function declaration, but it does check when you actually use the function below.
Other than that, yes - it should work.