$rawitems = array(array('nope1' => 'a', 'nope2' => 'b'), array('nope1' => 'c', 'nope2' => 'd')); $itemskey = array('key1', 'key2'); foreach ($rawitems as $row) { $items[] = array_combine($itemskey, $row); }
Related questions
Find more questions by tags PHP