I have an array that has been sorted ($sortProgDetails):
items: array:3 [▼
1 => array:4 [▶]
0 => array:4 [▶]
2 => array:4 [▶]
]
I then want to loop through it in the way it currently appears but using the key as 0,1,2, not by 1,0,2. How can i achieve this?
Example of the loop where i want to return the row id on item with key = 1, then 0, then 2. so instead of the first $key = 1, i want that to be 0.
foreach ($sortProgDetails as $key=>$progDetails) {
$getCurrentRow = Programmes::where('reference', $sortProgDetails [$key]['reference'])->get()[0]['id'];
}