整个数组

So I am making a little Mail form for practice, anyways.

I want to make a array of emails that cant be emailed to,

$nomail = array("hego556@yahoo.com","firevm@yahoo.com");
if($_POST["to"]!=$nomail)
  mail($_POST["to"],$_POST["subject"],$_POST["message"],$headers);
else
  echo "Not Allowed To Email That Email";

How do I?

You're looking for in_array.

if (!in_array($_POST["to"], $nomail)) {

http://us3.php.net/in_array

Change the line if($_POST["to"]!=$nomail) to if (in_array($_POST['to'], $noemail))

Relevant

$nomail = array('hego556@yahoo.com', 'firevm@yahoo.com');

if (!in_array($_POST['to'], $nomail)) {
    mail($_POST["to"],$_POST["subject"],$_POST["message"],$headers);
} else {
    echo 'Not Allowed To Email That Email';
}