Converting php array of arrays into single array
why complicate things?
foreach($array as $k=>$v) {
$new[$k] = $v['username'];
}
Since PHP 5.6 you can use the splat operator. In case array keys are numeric, you could use this:
$newArray = array_merge(...$oldArray);
Since PHP 5.5.0 there is a built-in function array_column
which does exactly this.
$new_array = array_column($last_array, 'username');