I am fetching rows from the DB and returning the result in JSON. The output needs to be an array of associative arrays.$i = 0;foreach($resultSet as $r){  $output[$i]['key1'] = $r['col1'];  $output[$i]['key2'] = $r['col2'];  ...  $output[$i]['keyN'] = $r['colN'];  $i++;}Is there a more elegant way to do this? Is there anything wrong with this approach? If yes, what is it?
Creating an array of associative arrays in PHP
php;performance