adding to an array
| From: | rdkurth at starband dot net | Date: | Mon, 24 Feb 2003 00:34:49 +0000 |
| Subject: | adding to an array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-136796@lists.php.net to get a copy of this message | ||
Hello ,
I need a way to read the following text file and add to or delete from
or change the data.
I have been able to move it all into an array using this code
$groups= file("group");
for ($i=0; $i<$number_in_group; $i++){
}
But I can not figure out how to search the array and delete from or add
to the array at a given point. I would like to say add another user to
the end of site6 or delete a user from site3.
Could sombody give me a hand here. I have read the manual for arrays
and still can't figure it out.
site1:x:503:tester1
site2:x:504:tester2,tester2a
site3:x:505:tester3,tester3a,tester3b
site4:x:506:tester4
site5:x:507:tester5,tester5a,tester5b
site6:x:508:tester6
site7:x:509:tester7,tester7a,tester7b
--
Best regards,
rdkurth mailto:rdkurth@starband.net