I'm trying to load a two dimensional array from PHP, now I want to access each position of the array, to add it to an HTML element.
My actual code:
<script>
$(document).ready(function() {
var stores = <?php echo json_encode($stores); ?>;
console.log(stores[2][0])
});
</script>
Sadly the console returns "undefined".
How could I access for example only the id of the second store?
console.log( stores[2]['id'] );?