- print_r: documentation ( source)
- array_walk: documentation ( source)
- printf: documentation ( source)
<?php
$table_array = array();
$result = array('hi', 'hello', 'there');
array_walk($result, function(&$row) {
printf('%s ', $row);
$index = &$row;
$table_array[$index] = array();
});
print_r($table_array);