How do I split an alphabetical list (array) into A-M and N-Z?
| From: | Daevid Vincent | Date: | Wed, 03 Jul 2002 11:52:39 +0000 |
| Subject: | How do I split an alphabetical list (array) into A-M and N-Z? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-105147@lists.php.net to get a copy of this message | ||
Anyone have a function that will take an alphabetical list of names (in
an array already) and split it into two 'chunks' (arrays) A-M and N-Z?
So, let's say I have:
Abby Road
BobbyCraft
Darren's doodads
Farenheit 456
generic name
MyCom.com
Ninety Nine
NoCo
O U 1
O'reilly Publishing
Oracle
PSI
Test Company
I want to end up with one array/chunk that has (A-M):
Abby Road
BobbyCraft
Darren's doodads
Farenheit 456
generic name
MyCom.com
And the other that contains (N-Z):
Ninety Nine
NoCo
O U 1
O'reilly Publishing
Oracle
PSI
Test Company