This is not a duplicate of How to pass variables and data from PHP to JavaScript?
After consulting the previous question, I have another :
My problem is that when I get the php array in Js, and I print it, I have just [object][object]
<?php
$tl = array(
0=>array('a', 'b', 1),
1=>array('c', 'd', 2)
);
?>
and javascript :
<script type="text/javascript">
var arr= <?php echo json_encode($tl ); ?>;
for(var i=0;i<3;i++){
alert(arr[i]);
}
</script>