Wednesday, August 3, 2016

PHP- How to change the array key to start from 1 instead of 0 ?

how to change the array key to start from 1 instead of 0 ?

$newarr = array_combine(range(1, count($oldarr)), array_values($oldarr));

No comments :

Post a Comment