title: warning: mail() expects parameter 4 to be string
body: <p>I'm trying to use the below code to send mail, but got the below error
  Doesn't <code>mail()</code> take in arrays for headers?</p>
  
  <pre><code>Warning: mail() expects parameter 4 to be string, array given in ../email.php on line 16
  </code></pre>
  
  <p>code :</p>
  
  <pre><code>&lt;?php
  $name       = @trim(stripslashes($_POST['name'])); 
  $from       = @trim(stripslashes($_POST['email'])); 
  $subject    = @trim(stripslashes($_POST['subject'])); 
  $message    = @trim(stripslashes($_POST['message'])); 
  $to         = 'example@gmail.com';
  
  $headers   = array();
  $headers[] = "MIME-Version: 1.0";
  $headers[] = "Content-type: text/plain; charset=iso-8859-1";
  $headers[] = "From: {$name} &lt;{$from}&gt;";
  $headers[] = "Reply-To: &lt;{$from}&gt;";
  $headers[] = "Subject: {$subject}";
  $headers[] = "X-Mailer: PHP/".phpversion();
  
  mail($to, $subject, $message, $headers);
  </code></pre>