I need to pass an array via POST to my PHP controller, the only way I have in mind is not to pass an array, but to pass the information through a separator (,; |), but I did not want to have to keep blowing up the other side (Controller).
At the moment I'm doing the following, Javascript:
var listaEnvioArray = new Array();
var item = new Array();
item["id"] = 1;
item["descricao"] = "teste";
listaEnvioArray.push(item);
$.post(basepath + "perfil/meuController", {
array : listaEnvioArray
}, function(dados) {
// TODO ação
});
In my controller I'm recovering this way (CodeIgniter):
$dados['array'] = $this->input->post('array');
But the same thing comes empty here.