I have the following arrangement that I want to send by ajax jquery by post to php codeigniter
var array = [];
(2) [Object, Object]
0
:
Object
Codigo
:
"11111"
Descripción
:
"caja"
Eliminar
:
" Eliminar"
Precio
:
"$46"
__proto__
:
Object
1
:
Object
Codigo
:
"22222"
Descripción
:
"lapiz"
Eliminar
:
" Eliminar"
Precio
:
"$222"
__proto__
:
Object
length
:
$.ajax({
type: "POST",
url: "<?php print base_url();?>controlador/Guardar",
data: array,//no se como mandar la data a php
success: function(objView){
alert("volvio");
}
});
what form would I have to receive it in php codeigniter?
I tried this code but it returns an array null thank you very much
public function Guardar(){
$data = json_decode(stripslashes($_POST['array']));
echo var_dump($data);
}