RE: [PHP] array insights

2006-05-04 Thread Ford, Mike
On 03 May 2006 18:27, Jason Gerfen wrote: I am looking for some information on how to do this the correct way, here is the data I am working with: Array ( [hostname-0] = hostname [mac-0] = 00:0a:b3:aa:00:5d [ip-0] = 192.168.0.1 [subnet] = MMC-Subnet [group] =

Re: [PHP] array insights

2006-05-03 Thread Dave Goodchild
use: $new_array = array_chunk($input_array, 3)); this will split your original array into a number of arrays with three elements in each and trash the original keys. If you want to preserve the keys pass a third paramater (true). Hope this helps. On 03/05/06, Jason Gerfen [EMAIL PROTECTED]

Re: [PHP] array insights

2006-05-03 Thread Robert Cummings
On Wed, 2006-05-03 at 13:27, Jason Gerfen wrote: I am looking for some information on how to do this the correct way, here is the data I am working with: Array ( [hostname-0] = hostname [mac-0] = 00:0a:b3:aa:00:5d [ip-0] = 192.168.0.1 [subnet] = MMC-Subnet [group] =

Re: [PHP] array insights

2006-05-03 Thread Robert Cummings
On Wed, 2006-05-03 at 13:27, Dave Goodchild wrote: use: $new_array = array_chunk($input_array, 3)); this will split your original array into a number of arrays with three elements in each and trash the original keys. If you want to preserve the keys pass a third paramater (true). Hope

Re: [PHP] array insights

2006-05-03 Thread Jason Gerfen
Dave Goodchild wrote: use: $new_array = array_chunk($input_array, 3)); Thanks, that is just the array function I was looking for. this will split your original array into a number of arrays with three elements in each and trash the original keys. If you want to preserve the keys pass a

Re: [PHP] array insights

2006-05-03 Thread Robert Cummings
On Wed, 2006-05-03 at 13:42, Jason Gerfen wrote: Dave Goodchild wrote: use: $new_array = array_chunk($input_array, 3)); Thanks, that is just the array function I was looking for. Really? Wow! That'll produce nothing like the example you said you wanted. *lol* Cheers, Rob. --