如果我有以下数组:
Array(
[0] => 30
[1] => 60
[2] => 2
[3] => 55
[4] => 1
[5] => 20
[6] => 1
[7] => 8
[8] => 38
[9] => 58
[10] => 12
)
我将如何删除第一个元素,然后在末尾添加一个新元素。所以新数组看起来像这样:
Array(
[0] => 60
[1] => 2
[2] => 55
[3] => 1
[4] => 20
[5] => 1
[6] => 8
[7] => 38
[8] => 58
[9] => 12
[9] => 10
)
我可以使用 array_push 添加到末尾,但是我将如何删除第一个元素并重新定位键?