title: PHP mail() sends empty variables
body: <p>I have a validation class that outputs an array ($arr) <code>$validates = Comment::validate($arr);</code> I use the array for PHP's mail function: <code>$email=$arr['email'];  $name=$arr['name']; $message=$arr['comment'];</code>.
  The mail gets send without problems, but the script behaves is if the variables were empty, but they are not (I have tested it with an <code>echo</code> statement). However <code>$name=$_POST['name'];</code> etc. works just fine. Any suggestions why this is happening? Here is part of the code.</p>
  
  <pre><code>$validates = Comment::validate($arr); // validate and fetch data, can be either TRUE or FALSE (1 or 0)
  
  
  // ------------- CONFIGURABLE SECTION ------------------------
  $mailto = 'email@bla.de'; // set to the email address you want the form sent to
  $subject = "Feedback Form"; // $subject - set to the Subject line of the email
  $formurl = "feedback.html" ;
  $errorurl = "feedback_error.php" ;
  $thankyouurl = "feedback_thankyou.php" ;
  $uself = 0;
  $email = $arr['email'];
  $name = $arr['name'];
  $message = $arr['comment'];
  // In case any of our lines are larger than 70 characters, we should use wordwrap()
  $message = wordwrap($message, 70, "\r\n"); // \n Line Feed, \r Carriage Return
  
  $headers   = array();
  $headers[] = "MIME-Version: 1.0";
  $headers[] = "Content-type: text/plain; charset=iso-8859-1";
  $headers[] = "From: Sender Name &lt;sender@domain.com&gt;";
  $headers[] = "Bcc: JJ Chong &lt;bcc@domain2.com&gt;";
  $headers[] = "Reply-To: Recipient Name &lt;receiver@domain3.com&gt;";
  $headers[] = "Subject: {$subject}";
  $headers[] = "X-Mailer: PHP/".phpversion();
  
  
  // -------------------- END OF CONFIGURABLE SECTION ---------------
  
  $http_referrer = getenv( "HTTP_REFERER" );
  $js_enabled = $_POST['js_enabled'];
  
  //--------------------------------------------------------
  if($validates) {
  //echo 'message: '.$message; &lt;-- this works (it's not empty)
  
  $msg = array();
  $msg[] = "Nachricht von: ".$http_referrer;
  $msg[] = "Name des Absenders: ".$name;
  $msg[] = "E-Mail des Absenders: ".$email;
  $msg[] = "------------------------- Nachricht -------------------------";
  $msg[] = $message; // &lt;-- this is not working ??? ($message=$_POST['comment']; works just fine)
  $msg[] = "--------------------------------------------------------------";
  
  mail($mailto, $subject, implode("\r\n",$msg), implode("\r\n",$headers));
  
  
  // THANK YOU URL 
  if ($js_enabled == '0') { // IF NO jAVASCRIPT
      header("Location: $thankyouurl"); 
      exit; 
  } // ELSE AJAX REQUEST
  echo json_encode(array('status'=&gt;1));
  // echo '{"status":1}';
  } else { // ERROR URL 
      if ($js_enabled == '0') { // IF NO jAVASCRIPT 
          $err = serialize($arr);
          $err_url = urlencode($err);
          header("Location: $errorurl?errors=$err_url"); exit; 
      } // ELSE AJAX REQUEST
      echo '{"status":0,"errors":'.json_encode($arr).'}';
  }
  </code></pre>