PHP 8
Intermediate
Basics
· 1 min read
Multidimensional arrays
How do I store rows of data?
Arrays of arrays.
Example
<?php
$students = [
['name' => 'Ada', 'score' => 95],
['name' => 'Alan', 'score' => 88],
];
echo $students[0]['name'];
Line-by-Line Walkthrough
Common shape when fetching multiple DB rows.