ID: 15562 Updated by: [EMAIL PROTECTED] -Summary: New additions to the array family "array_insert" Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.1.1 New Comment:
per request.. Previous Comments: ------------------------------------------------------------------------ [2002-02-14 22:50:49] [EMAIL PROTECTED] I believe it would be a very handy feature to have an "array_insert" function (with re-key'ing). I am in need of such an item and thus my request. What I mean by this is if I already have an array with numerical keys, and elements filled in, I would like to be able to insert an element into this pre-existing array. So if I had 10 elements in my array, all with a key index. I have a new element that I want to insert into this array, without popping off the end or from the top...I want it in a specific spot in the array. So I have "newelement" which I want in key5, so I would "array_insert(key(5),newelement)" which would insert it at the appropriate spot without deleting anything there, and "newelement" would now have the key "key5" and the old key5 would now just be key6 and so on, so that I know have 11 elements with numerical keys. Thanks John If that is not clear, please write me and I'll make it more clear. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15562&edit=1