PHP array bidimensional
Un <array bidimensional> es un array cuyos elementos también son arrays. Vea el ejemplo:
<?php
$arr = [
'boys' => ['John', 'Nick', 'Alex'],
'girls' => ['Mary', 'Helen', 'Jane'],
];
echo $arr['boys'][0];
?>
Vamos a mostrar usando nuestro array,
por ejemplo, 'Nick':
<?php
$arr = [
'boys' => ['John', 'Nick', 'Alex'],
'girls' => ['Mary', 'Helen', 'Jane'],
];
echo $arr['boys'][1]; // mostrará 'Nick'
?>
Y ahora mostremos 'Jane':
<?php
$arr = [
'boys' => ['John', 'Nick', 'Alex'],
'girls' => ['Mary', 'Helen', 'Jane'],
];
echo $arr['girls'][2]; // mostrará 'Jane'
?>