3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 'value' => [ 'lesson_id' => ['1', '6'], 'knowledge_value' => ['2', '7'], 'knowledge_description' => ['3', '8'], 'skill_value' => ['4', '9'], 'skill_description' => ['5', '10'], ], ]; $temp = []; $keys = array_keys($a['value']); for ($i = 0; $i < count($a['value']['lesson_id']); $i++) { $temp['value'][] = array_combine($keys, array_column($a['value'], $i)); } print_r($temp);die;

preferences:
169.8 ms | 407 KiB | 5 Q