how to write the code for delting duplicate lines?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
swetha
Forum Commoner
Posts: 88
Joined: Wed Sep 10, 2008 11:00 pm

how to write the code for delting duplicate lines?

Post by swetha »

i need to develop a tool which deleted duplicate lines in a textarea.
how do i write the code for it?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: how to write the code for delting duplicate lines?

Post by requinix »

Get the text, break it into an array, use array_flip, use array_flip again, and turn it back into a string.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: how to write the code for delting duplicate lines?

Post by VladSun »

Nice one, tasairis
:)
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply