array question--help

From: Date: Sun, 28 Apr 2002 04:57:47 +0000
Subject: array question--help
Groups: php.general 
Request: Send a blank email to php-general+get-94963@lists.php.net to get a copy of this message
I am a Newbie at PHP I am sure I am missing something small but... I am trying to create a form selection box which an alphabetically sort list of a unix group file. The group file has the format groupname::groupnumber: I have tried to create an array using the array=fgetcsv($fp, 30, ":") which does read each line of the file. I have used this line in a while loop and also a for loop, but everytime I exit the loop, the array now has no information. I found if the change the line to be array[]=fgetcsv($fp, 30, ":") then I can exit the loops but now how do extract only the group names from the array and be able to sort them. Ideally what I would like to do is create an array where the keys = group number and value = groupname. I need to be able to natsort the values and display in the selection form box. Help!?!?!?!?!?!?

« previous php.general (#94963) next »