chunk array and group a new one

Run Settings
LanguagePHP
Language Version
Run Command
<?php $arr = [ '001', 1, '002', 2, '003', 3, '004', 4 ]; $result = []; $groups = array_chunk($arr, 2); foreach($groups as $group) { $result[] = [ 'id' => $group[0], 'num' => $group[1], ]; } print_r($result);
Editor Settings
Theme
Key bindings
Full width
Lines