I find a big problem, I want to add an array within an array, but I can not find a solution, my code is this:
$arrayDetalle = Array();
for($i = 0; $i < $this->contArticulos; $i++){
$arrayDetalle = array(
"Nombre" => $this->nombreVFI[$i],
"Cantidad" => $this->cantidadVFI[$i],
"Subtotal" => $this->costo_subtotalVFI[$i],
"Total" => $this->costo_subtotalVFI[$i] + $this->costo_impuestoVFI[$i],
"Codigo" => $this->codigoVFI[$i],
"Impuestos" => array(
"Impuesto" => $this->impuestoVFI[$i],
"Porcentaje" => $this->valor_impuestoVFI[$i],
"TotalImp" => $this->costo_impuestoVFI[$i]
)
);
}
And then I need to convert that array into a json and display it on the screen, but when I print it, nothing appears on the screen:
$json = json_enconde($arrayDetalle);
echo $json;