title: how to make $_POST['value'] as numeric array to do foreach
body: <p>I have a question here on how to parse a <code>$POST_['value'] (e.g 3785,3789,3790,3787 )</code> from a form to an <code>array($POST_['value'])</code> and do foreach. Please see the sample code below:</p>
  
  <pre><code>function someFunction(){
      $html = '';
      $int = $_POST['Ids']; //POST the value as 3785,3789,3790,3787
      $IDs = array($int);
  
      foreach ($IDs as $ID) {
          $intVal = '&lt;int&gt;' . $ID .'&lt;/int&gt;';
          $html .= $intVal;
      }
  
      return $html;
  }
  </code></pre>
  
  <p>however the result displays it as the ****whole string** rather than array**.
  And if I put the <code>array(3785,3789,3790,3787)</code> like this, it will parse as array in foreach. How to convert the <code>$POST_['IDs']</code> to number or some sort in order to be recognised as array?</p>
  
  <p>Thanks </p>
  
  <p>Mike</p>