title: Concatinate json output response
body: <p>I am using a AJAX /php form . </p>
  
  <pre><code>if (strlen($name) &lt; 4) { // If length is less than 4 it will output JSON error.
      $output = json_encode(array('type' =&gt; 'error', 'text' =&gt; '&lt;br /&gt; - ' . _t('"Naam" field contains invalid value')));
      die($output);
  }
  if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { //email validation
      $output = json_encode(array('type' =&gt; 'error', 'text' =&gt; '&lt;br /&gt; - ' . _t('"E-mail" field contains invalid value')));
      die($output);
  }
  if (strlen($subject) &lt; 3) { //check emtpy message
      $output = json_encode(array('type' =&gt; 'error', 'text' =&gt; '&lt;br /&gt; - ' . _t('"Onderwerp" field contains invalid value')));
      die($output);
  }
  if (strlen($message) &lt; 3) { //check emtpy message
      $output = json_encode(array('type' =&gt; 'error', 'text' =&gt; '&lt;br /&gt; - ' . _t('"Vraag" field contains invalid value')));
      die($output);
  }
  </code></pre>
  
  <p>The AJAX script :</p>
  
  <pre><code>$.post('contact_form', post_data, function (response) {
      if (response.type == 'error') { //load json data from server and output message     
          output = '&lt;div class="error"&gt;' + response.text + '&lt;/div&gt;';
      } else {
          output = '&lt;div class="success"&gt;' + response.text + '&lt;/div&gt;';
          //reset values in all input fields
          $("#contact_form  input[required=true], #contact_form textarea[required=true]").val('');
          $("#contact_form #contact_body").slideUp(); //hide form after success
      }
      $("#contact_form #contact_results").hide().html(output).slideDown();
  }, 'json');
  </code></pre>
  
  <p>The above code it valides form and output if is there any error.
  My issue is that i receive 1 error only. How can i receive all the errors in a json object ?</p>