The following code:
$ids=['one','two','three','two','four'];
echo('<pre>'.print_r($ids,1).'</pre>');
$ids = array_unique($ids);
echo('<pre>'.print_r($ids,1).'</pre>');
produces the following:
Array
(
[0] => one
[1] => two
[2] => three
[3] => two
[4] => four
)
Array
(
[0] => one
[1] => two
[2] => three
[4] => four
)
How do I preserve consecutive array indexes and produce the following:
Array
(
[0] => one
[1] => two
[2] => three
[3] => four
)