2

我从数组(列表#1)中删除重复项,array_uniqe但如何将其输出(列表#2)的kyes重新计算为[0-x](列表#3):

清单 #1:

 array (size=24)
          0 => string '2013-09-18' (length=10)
          1 => string '2013-09-18' (length=10)
          2 => string '2013-09-18' (length=10)
          3 => string '2013-09-18' (length=10)
          4 => string '2013-09-19' (length=10)
          5 => string '2013-09-19' (length=10)
          6 => string '2013-09-19' (length=10)
          7 => string '2013-09-19' (length=10)
          8 => string '2013-09-19' (length=10)
          9 => string '2013-09-19' (length=10)
          10 => string '2013-09-19' (length=10)
          11 => string '2013-09-20' (length=10)
          12 => string '2013-09-20' (length=10)
          13 => string '2013-09-20' (length=10)
          14 => string '2013-09-20' (length=10)
          15 => string '2013-09-21' (length=10)
          16 => string '2013-09-21' (length=10)
          17 => string '2013-09-21' (length=10)
          18 => string '2013-09-21' (length=10)
          19 => string '2013-09-21' (length=10)
          20 => string '2013-09-21' (length=10)
          21 => string '2013-09-22' (length=10)
          22 => string '2013-09-22' (length=10)
          23 => string '2013-09-22' (length=10)

清单 #2:

array (size=5)
  0 => string '2013-09-18' (length=10)
  4 => string '2013-09-19' (length=10)
  11 => string '2013-09-20' (length=10)
  15 => string '2013-09-21' (length=10)
  21 => string '2013-09-22' (length=10)

清单 #3:

array (size=5)
  0 => string '2013-09-18' (length=10)
  1 => string '2013-09-19' (length=10)
  2 => string '2013-09-20' (length=10)
  3 => string '2013-09-21' (length=10)
  4 => string '2013-09-22' (length=10)
4

1 回答 1

8
$list3 = array_values($list2);
于 2013-09-22T15:16:44.137 回答