Author Topic: [SOLVED] how do I do this with arrays?  (Read 103 times)

0 Members and 1 Guest are viewing this topic.

Offline aebstractTopic starter

  • Devotee
    • View Profile
[SOLVED] how do I do this with arrays?
« on: October 03, 2008, 08:53:26 AM »
Fairly simple question I think, I've just never had to do it before. I'm going to have an array with like 300 items or more and need to be able to delete duplicate items. Is there a function or something I am looking for to do this? Don't want anyone to write it for me but show me which direction to go. Thanks.

Array example in case my description sucks:

0 - alpha
1 - beta
2 - charlie
3 - beta (gets deleted)
4 - delta
5 - alpha (gets deleted)
There is an area of the mind that could be called unsane, beyond sanity, and yet
not insane. Think of a circle with a fine split in it. At one end there's
insanity. You go around the circle to sanity, and on the other end of the
circle, close to insanity, but not insanity, is unsanity.

Offline Nightslyr

  • Addict
  • Gender: Male
    • View Profile
Re: how do I do this with arrays?
« Reply #1 on: October 03, 2008, 09:05:45 AM »
Fairly simple question I think, I've just never had to do it before. I'm going to have an array with like 300 items or more and need to be able to delete duplicate items. Is there a function or something I am looking for to do this? Don't want anyone to write it for me but show me which direction to go. Thanks.

Array example in case my description sucks:

0 - alpha
1 - beta
2 - charlie
3 - beta (gets deleted)
4 - delta
5 - alpha (gets deleted)


http://www.php.net/manual/en/function.array-unique.php
Things you should know before posting:
1. The rules
2. How to use CODE tags

In most cases, the code I provide hasn't been tested.  Keep that in mind if it doesn't work 100% correctly the first time.

Offline aebstractTopic starter

  • Devotee
    • View Profile
Re: how do I do this with arrays?
« Reply #2 on: October 03, 2008, 09:10:27 AM »
Thank you :)
There is an area of the mind that could be called unsane, beyond sanity, and yet
not insane. Think of a circle with a fine split in it. At one end there's
insanity. You go around the circle to sanity, and on the other end of the
circle, close to insanity, but not insanity, is unsanity.

PHP Freaks Forums

« on: »

Tired of these ads? Purchase a supporter subscription to get rid of them.