title: Manage form-data + other variable sent via ajax to php
body: <p>My question is probably basic, but there is the question:</p>
  
  <p>I have a javascript function which sends an array via ajax to process some information...</p>
  
  <pre><code>  var second = $('form.contact').serialize();
    var arry = {keystatus: varId, keyname: second}
  </code></pre>
  
  <p>In php, I added the data sent via ajax a array and wrote an echo to see in ajax success, displaying via console.log.</p>
  
  <p>What do I get: </p>
  
  <p><a href="https://i.stack.imgur.com/p93x6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p93x6.jpg" alt="enter image description here"></a></p>
  
  <p>My php script: </p>
  
  <p>
  
  <pre><code>$name = strip_tags($_POST['keystatus']);
  $email = strip_tags($_POST['keyname']);
  
  $teste['nome'] = $name;
  $teste['email'] = $email;
  
  echo json_encode($teste);
  </code></pre>
  
  <p>I needed to find a way to get separate, for example:</p>
  
  <pre><code>$_POST['keyname']['nome'] -&gt; (in this example) discovery
  $_POST['keyname']['email'] -&gt; discovery@discovery.com
  $_POST['keyname']['usuario'] -&gt; discovery
  </code></pre>