<?php $array = [2,3,4,5]; $index = "a"; $arrayB = array_map(function ($element) { $index++; return array($index => $element); }, $array); print_r($arrayB);
You have javascript disabled. You will not be able to edit any code.