Resetting the value of array in contiguous integers(1,2,3,4...) using foreach in PHP
I have a array like(1,3,3,4,5,6)
how can i reset the values like (1,2,3,4,5,6) using foreach loop
Resetting the value of array in contiguous integers(1,2,3,4...) using foreach in PHP
I have a array like(1,3,3,4,5,6)
how can i reset the values like (1,2,3,4,5,6) using foreach loop
$i = 1;
foreach($array as &$item)
$item = $i++;