6
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 didn’t want to keep giving it explodes on 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 am recovering this way(Codeigniter):
$dados['array'] = $this->input->post('array');
But the same comes empty here.
Valeeu, I’ll test tomorrow at work
– Alessandro Gomes
It worked perfectly! Thank you very much!
– Alessandro Gomes