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 > [gr

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. -

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 thir

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). Ho

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 >

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]>

[PHP] array insights

2006-05-03 Thread Jason Gerfen
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] => MMC-PXE [hostname-1] => tester01 [mac-1] => 00:09:02