Forum Moderators: coopster

Message Too Old, No Replies

Finding unique records

         

babloo

9:51 am on Oct 13, 2004 (gmt 0)

10+ Year Member



Hello,

I have a text file with so many records.
I need to find the unique name from the record.

format of text file
id name

1 abc
2 bbb
3 vvv
4 abc
5 bbb

Please help me in this. I need to get the unique name from the above text file.

THanks

Birdman

10:56 am on Oct 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello,

Try putting the text file in an array with file() [us2.php.net]. Then you can use array_unique [us2.php.net]. Actually, it's probably not quite that simple but those functions should get youo on your way to a solution.

Birdman

SofterLogic UK

11:26 am on Oct 13, 2004 (gmt 0)

10+ Year Member



read it into an array, one at a time. as you read each, check if it's already in the array (if so discard)