I have and array and i need to push a value into the first index(0).
array:3 [▼
4 => "test1"
5 => "test2"
6 => "test3"
]
I need the indexes to stay like this, so the array will become like below. Since the indexes are the IDS of the values.
array:3 [▼
0 => "None selected"
4 => "test1"
5 => "test2"
6 => "test3"
]
To populate array:
$accuGroups = UpselGroup::where('accu_group','1')->with('UpselProducts.products')->pluck('naam','id')->toArray();
What i tried:
$accuGroups = array_merge([0 => 'None selected'], $accuGroups);
outcome (not what i want):
array:4 [▼
0 => "None selected"
1 => "test1"
2 => "test2"
3 => "test3"
]
Any help is appreciated
thanks