Array Slice without loosing index

From: Date: Wed, 28 Nov 2007 05:59:35 +0000
Subject: Array Slice without loosing index
Groups: php.general 
Request: Send a blank email to php-general+get-265112@lists.php.net to get a copy of this message
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

« previous php.general (#265112) next »