title: How to get the value of a $_POST, if it is an array in PHP?
body: <p><a href="https://i.stack.imgur.com/MChcM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MChcM.jpg" alt="I added an image showing the response when I use  var_dump($emails);"></a>Let's say I have an array of emails </p>
  
  <pre><code>['email1', 'email2'...'email(n)']; 
  </code></pre>
  
  <p>submitted to a form, </p>
  
  <p>How do I store this values into a variable, 
  ie, </p>
  
  <pre><code>$emails = $_POST['emails'];
  </code></pre>
  
  <p>but this does not work as it sees the value ($emails) as a string rather than an array. </p>
  
  <p>I have also tried </p>
  
  <pre><code>$emailsArray = explode(' ', $emails);
  </code></pre>
  
  <p>while the $emailsArray is of type array , it fails cause it groups all elements as a single string</p>
  
  <p>Remember the email is dynamic and cannot be predicted its length. </p>