I have three variables retrieved from a database and I would like the first variable to be the key for the second variable and for that second variable to be the key for the third variable. In essence a two-dimensional array.
while($row = $statement->fetch(PDO::FETCH_ASSOC))
{
$unit_id = $row['id'];
$unit_code = $row['unit_name'];
$unit_description = $row['unit_description'];
$units = [$unit_id => $unit_code];
$units += [$unit_code => $unit_description];
}
return $units;