<?php $a = [ 'firstname' , 'bob' , 'lastname' , 'alex' ]; $new = array_combine( array_intersect_key($a, array_flip(range(0, count($a) - 1, 2))), array_intersect_key($a, array_flip(range(1, count($a) - 1, 2))) ); print_r($new);
You have javascript disabled. You will not be able to edit any code.