RE: [PHP] Array Slice without loosing index

2007-11-27 Thread Andrés Robinet
Notice that the fourth parameter of array_slice will only work in PHP 5, and not for string keys. There's no associative array slicing function that I know of (it would be a good idea for PHP to incorporate one), so I use the following two, which work for numeric or string keys, and work for PHP 4

Re: [PHP] Array Slice without loosing index [SOLVED]

2007-11-27 Thread Jeffery Fernandez
oops me bad.. I just needed the last (4th) parameter added. cheers, Jeffery On Wed, 28 Nov 2007 04:59:35 pm Jeffery Fernandez wrote: > Hi all, > > I am wanting to retain the array indexes after it being sliced. Here is > what I have so far. > > if ($user_count > $group_count) > { > for ($i