title: add array telephone in existing php form
body: <p>I have a form in my website, and it works well. It was part of a oakler template and so far I received subject,email,message information back.
  I added a telephone field trying to follow the structure of the form but am no php expert and don't know what is not working. 
  In the email sent I receive the field 'telephone' but it is empty. </p>
  
  <p>Please help.</p>
  
  <p>The website is this: <a href="http://ruidematos.co.uk/contact-psychologist-hypnotherapist-london-harley-street" rel="nofollow noreferrer">http://ruidematos.co.uk/contact-psychologist-hypnotherapist-london-harley-street</a></p>
  
  <p>The form html is this: </p>
  
  <pre><code>&lt;form id="contactForm" action="php/contact-form.php" method="POST"&gt;
  &lt;div class="row"&gt;
  &lt;div class="form-group"&gt;
  &lt;div class="col-md-12"&gt;
  &lt;input type="text" placeholder="Subject" value="" data-msg-required="Please enter the subject." maxlength="100" class="form-control input-lg" name="subject" id="subject" required&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;
  &lt;div class="form-group"&gt;
  &lt;div class="col-md-12"&gt;
  &lt;textarea maxlength="5000" placeholder="Message" data-msg-required="Please enter your message." rows="10" class="form-control input-lg" name="message" id="message" required&gt;&lt;/textarea&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;
  &lt;div class="form-group"&gt;
  &lt;div class="col-md-12"&gt;
  &lt;input type="text" placeholder="Your Name" value="" data-msg-required="Please enter your name." maxlength="100" class="form-control input-lg" name="name" id="name" required&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;
  &lt;div class="form-group"&gt;
  &lt;div class="col-md-12"&gt;
  &lt;input type="email" placeholder="Your E-mail" value="" data-msg-required="Please enter your email address." data-msg-email="Please enter a valid email address." maxlength="100" class="form-control input-lg" name="email" id="email" required&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;
  &lt;div class="form-group"&gt;
  &lt;div class="col-md-12"&gt;
  &lt;input type="text" placeholder="Your Telephone" value="" data-msg-required="Please enter your telephone." data-msg-email="Please enter a valid number." maxlength="30" class="form-control input-lg" name="phone" id="phone" required&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;
  &lt;div class="col-md-12"&gt;
  &lt;input type="submit" value="Send Message" class="btn btn-primary btn-lg mb-xs" data-loading-text="Loading..."&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The PHP code is this:</p>
  
  <pre><code>session_cache_limiter('nocache');
  header('Expires: ' . gmdate('r', 0));
  
  header('Content-type: application/json');
  
  require_once('php-mailer/PHPMailerAutoload.php');
  
  // Step 1 - Enter your email address below.
  $email = 'info@ruidematos.co.uk';
  
  // If the e-mail is not working, change the debug option to 2 | $debug = 2;
  $debug = 0;
  
  $subject = $_POST['subject'];
  
  $fields = array(
      0 =&gt; array(
          'text' =&gt; 'Name',
          'val' =&gt; $_POST['name']
      ),
      1 =&gt; array(
          'text' =&gt; 'Email address',
          'val' =&gt; $_POST['email']
      ),
      2 =&gt; array(
          'text' =&gt; 'Message',
          'val' =&gt; $_POST['message']
      ),
      3 =&gt; array(
          'text' =&gt; 'Telephone',
          'val' =&gt; $_POST['phone']
      )
  );
  
  $message = '';
  
  foreach($fields as $field) {
      $message .= $field['text'].": " . htmlspecialchars($field['val'], ENT_QUOTES) . "&lt;br&gt;\n";
  }
  
  $mail = new PHPMailer(true);
  
  try {
  
      $mail-&gt;SMTPDebug = $debug;                                 // Debug Mode
  
      // Step 2 (Optional) - If you don't receive the email, try to configure the parameters below:
  
      //$mail-&gt;IsSMTP();                                         // Set mailer to use SMTP
      //$mail-&gt;Host = 'mail.yourserver.com';                     // Specify main and backup server
      //$mail-&gt;SMTPAuth = true;                                  // Enable SMTP authentication
      //$mail-&gt;Username = 'user@example.com';                    // SMTP username
      //$mail-&gt;Password = 'secret';                              // SMTP password
      //$mail-&gt;SMTPSecure = 'tls';                               // Enable encryption, 'ssl' also accepted
      //$mail-&gt;Port = 587;                                       // TCP port to connect to
  
      $mail-&gt;AddAddress($email);                                 // Add another recipient
  
      //$mail-&gt;AddAddress('person2@domain.com', 'Person 2');     // Add a secondary recipient
      //$mail-&gt;AddCC('person3@domain.com', 'Person 3');          // Add a "Cc" address. 
      //$mail-&gt;AddBCC('person4@domain.com', 'Person 4');         // Add a "Bcc" address. 
  
      $mail-&gt;SetFrom($email, $_POST['name']);
      $mail-&gt;AddReplyTo($_POST['email'], $_POST['name']);
  
      $mail-&gt;IsHTML(true);                                  // Set email format to HTML
  
      $mail-&gt;CharSet = 'UTF-8';
  
      $mail-&gt;Subject = $subject;
      $mail-&gt;Body    = $message;
  
      $mail-&gt;Send();
      $arrResult = array ('response'=&gt;'success');
  
  } catch (phpmailerException $e) {
      $arrResult = array ('response'=&gt;'error','errorMessage'=&gt;$e-&gt;errorMessage());
  } catch (Exception $e) {
      $arrResult = array ('response'=&gt;'error','errorMessage'=&gt;$e-&gt;getMessage());
  }
  
  if ($debug == 0) {
      echo json_encode($arrResult);
  }
  </code></pre>