I have an array in angularjs, Example as below.
$scope.order.qty='20';
$scope.order.adress='Bekasi';
$scope.order.city='Bekasi';
This array can post with this code
$http({
method : 'POST',
url : '<?php echo base_url(); ?>add_order',
data : $scope.order,
headers : {'Content-Type': 'application/x-www-form-urlencoded'}
})
I can get all variable with
$_POST = json_decode(file_get_contents('php://input'), true);
$_POST['qty'];
$_POST['address'];
$_POST['city'];
But I'm confused if array multi-dimensional like this :
$scope.items[1].kode_produk='PR_1';
$scope.items[2].kode_produk='PR_2';
$scope.items[3].kode_produk='PR_3';
How to post and get variable from array multi-dimensional like this ?