Page 1 of 1

Need low-memory consuming operation similar to array_unshift

Posted: Tue Jul 05, 2005 8:26 am
by tores
Hi

Have this huge array (up to 4MB) which I might have to extend by prepending elements to it at its' start.
array_unshift might have done the trick but resets my numerical keys, so I can't use it.
Is there some other way to do this without eating additional MBs of memory... E.g array_pop mixed with array_reverse???
Any suggestions?

regards tores

Posted: Tue Jul 05, 2005 8:34 am
by tores
Think I will just use

Code: Select all

$a1 = $a2 + $a1

Posted: Tue Jul 05, 2005 8:38 am
by Weirdan

Posted: Tue Jul 05, 2005 9:19 am
by djot