Possible duplicate:Paste into array at specific location
How to push 1 or more values ββto the middle (or a specific position / index) of an array? eg:
$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');
array_splice is probably what you are looking for:
array_splice
array_splice($a, 1, 0, array('c', 'd'));
Source: https://habr.com/ru/post/1396646/More articles:ActionBarSherlock not working in eclipse - androidImplicit C ++ type conversion in argument lists - c ++Nested select query in LEFT JOIN - sqlKassandra: Visited the last 10 users - cassandraPassing binary data to a DLL function in D7 - dllHTML colored texts - javascriptGesture Free Game - c #Lazy loading with jQuery treeTable - jqueryHow to run Android code in REPL - androidWhy is the asp.net user ID not stored on the ticket ID? - asp.netAll Articles