<?php
$rows = [
0 => [ 'id' => 89, 'language' => 'PHP'],
1 => [ 'id' => 23, 'language' => 'Java'],
2 => [ 'id' => 11, 'language' => 'VBA' ],
3 => [ 'id' => 17, 'language' => 'Ruby' ]
];
$i = 0;
foreach ($rows as $row) {
$data[] = [
'id' => $i,
'language' => $row['language']
];
$i++;
}
var_dump($data);
?>
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme