2012-02-15 2 views
4

Можно создать дубликат:
Insert into array at a specified placeтолчок к определенной позиции массива

Как нажать 1 или более значений в середине (или конкретной позиции/индекс) массива? , например:

$a = array('a', 'b', 'e', 'f'); 
array_pushTo($a, 1, 'c', 'd'); // that function i'm looking for. first parameter is the array, second is the index, and third and other are the values. 
// $a now is: array('a', 'b', 'c', 'd', 'e', 'f'); 
+0

'array_splice()' http://us3.php.net/manual/en/function.array- splice.php –

+0

Это должно помочь вам :) http://stackoverflow.com/questions/3797239/php-array-insert-new-item-in-any-position – ExtremeCoder

+0

Там будет ответ ниже, что может сделать с принятием. –

ответ

Смежные вопросы