title: Retrieving multiple post variables in a controller function in Codeingiter
body: <p>I am posting data to controller like this:</p>
  
  <pre><code>var postVars = new Array();
  postVars[0] = key;
  postVars[1] = haveCredits;
  postVars[2] = creditsNeeded;
  postVars[3] = creditsLeft;
  //alert(postVars.join("&amp;"));
  xhr.open('POST', 'ajax');
  xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  xhr.send(postVars.join("&amp;"));
  </code></pre>
  
  <p>How can i retrieve this values in my controller function?</p>
  
  <p>Controller code:</p>
  
  <pre><code>$variableValues= explode('&amp;',$this-&gt;input-&gt;post('postVars'));
  </code></pre>
  
  <p>It is returning an empty array.</p>
  
  <p>Thanks in advance.</p>