$arr = [23, 43, 543, 54];
[0 => 23, 1 => 43, 2 => 543, 3 => 54]
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given
<?php
$arr = [
['firsname' => 'Иван', 'lastname' => 'Иванов'],
['firsname' => 'Петр', 'lastname' => 'Петров'],
['firsname' => 'Сергей', 'lastname' => 'Сергеев'],
]
?>
<table>
<tr><th>ID</th><th>Имя</th><th>Фамилия</th></tr>
<?php foreach($arr as $key => $person): ?>
<tr>
<td><?=$key?></td>
<td><?=$person['firsname']?></td>
<td><?=$person['lastname']?></td>
</tr>
<?php endforeach ?>
</table>