reindex array php code example
Example: reindex array php
# starts from 0
$iZero = array_values($arr);
# starts from 1
$iOne = array_combine(range(1, count($arr)), array_values($arr));
# starts from 0
$iZero = array_values($arr);
# starts from 1
$iOne = array_combine(range(1, count($arr)), array_values($arr));