Let's say I have this:
$sth = query('SELECT col FROM table');
$arr = mysqli_fetch_all($sth, MYSQLI_NUM);
It works, but I end up with a confusing array of arrays:
Array
(
[0] => Array
(
[0] => foo
)
[1] => Array
(
[0] => bar
)
[2] => Array
(
[0] => lorem
)
)
I know that I could run it through a loop to make it a regular array:
foreach ($arr as $key => $val)
$newArr[] = $val[0];
print_r($newArr);
// Array
// (
// [0] => foo
// [1] => bar
// [2] => lorem
// )
but that seems like a total waste of resources.
Is there a way to set all of the results to a numeric array like that without a loop?