Re: Array Slice without loosing index [SOLVED]

From: Date: Wed, 28 Nov 2007 06:21:53 +0000
Subject: Re: Array Slice without loosing index [SOLVED]
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-265114@lists.php.net to get a copy of this message
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 = 0; $i < $user_count; $i+=$group_count) > { > $output = array_slice($properties['users'], $i, $group_count); > print_r($output); > } > } > > Every time the array is sliced it results with arrays which have new > idexes. Is there a way I can retain the array indexes when slicing the > array. > > regards, > Jeffery > -- > Internet Vision Technologies > Level 1, 520 Dorset Road > Croydon > Victoria - 3136 > Australia > web: http://www.ivt.com.au > phone: +61 3 9723 9399 > fax: +61 3 9723 4899 -- Internet Vision Technologies Level 1, 520 Dorset Road Croydon Victoria - 3136 Australia web: http://www.ivt.com.au phone: +61 3 9723 9399 fax: +61 3 9723 4899

« previous php.general (#265114) next »