Using php’s explode with the following code
$data="test_1, test_2, test_3";
$temp= explode(",",$data);
I get an array like this
array('0'=>'test_1', '1'=>'test_2', 2='test_3')
what I would like to have after explode
array('1'=>'test_1', '2'=>'test_2', 3='test_3')
You could something like this :
uses
array_combine()to create array using your existing values (usingarray_values()) andrange()to create a new range from 1 to the size of your arrayWorking example here