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

0 Members and 1 Guest are viewing this topic.

Offline aebstractTopic starter

  • Devotee
  • Posts: 1,103
    • 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 KevinM1

  • Global Moderator
  • Fanatic
  • *
  • Posts: 3,911
  • 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
Don't go to w3schools.  Here's why
Every time a PHP coder uses 'global' a kitten dies.

Offline aebstractTopic starter

  • Devotee
  • Posts: 1,103
    • 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.