<?php $myExistingArray = []; for ($i = 0; $i < 100; $i++) { $myExistingArray[] = ['key1' => '1234', 'key2' => '56', 'count' => 1]; } $myNewArray = []; foreach (array_keys($myExistingArray) as $item) { $myNewArray[$myExistingArray[$item]['key1'] . '_' . $myExistingArray[$item]['key2']] = $myExistingArray[$item]['count']; }
You have javascript disabled. You will not be able to edit any code.