I have to pass a php multidimensional array via ajax/jQuery to another php file. I have encoded the array using I expected theat every item in the array would have been an array itself. Instead it returns [Object object]. How can I access the data using php?
here's my code:
in the first php file:
<script type="text/javascript">
var arr_data = <?php echo json_encode($itemsData); ?>;
$("#confirmButton").click(function(){
$.post("send_test.php", {"my_array_data[]":my_array_data}, function( data ) {
alert(data);
});
});
</script>
the other php file:
<?php
$my_array_data = $_POST['my_array_data'];
?>
if I try to retrieve the first row ($my_array_data[0]
) I get [Object object]
I just want to access to $my_array_data[0]['category']
etc.