Well, isset() is one thing you would use...
Example:
// Generates a blank $error message to append to if needed by the error checking.
$error = "";
// The first part of the statement makes sure both fields are entered and are set by the form. If not, it generates the applicable error message to echo back to the user.
IF((!ISSET($_POST['email1']) || $_POST['email1'] == '') || (!ISSET($_POST['email2']) || $_POST['email2'] == '')):
$error .= "You must enter your email address into both fields";
// If both are filled in, it moves on to this part, and makes sure they match. If not, it generates the error message to echo back to the user.
ELSEIF($_POST['email1'] != $_POST['email2']):
$error .= "The email addresses you specified do not match, please try again.";
// If everything checks, go on to do whatever it is you plan to do with the email address.
ELSE:
// Process the address here
ENDIF;
Keep in mind this is just a start for you. You would want to use regular expressions to verify that it is an email address and not something like "JoeBlow". That would pass the above script if entered twice, but theoretically not the info you want since it isn't an email address.