Re: Deleting same values from an array
| From: | John W. Holmes | Date: | Fri, 22 Aug 2003 23:43:47 +0000 |
| Subject: | Re: Deleting same values from an array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160466@lists.php.net to get a copy of this message | ||
Stephen Craton wrote:
Hello, I have an array called $stems that has a bunch of numbers in it like 2, 5, 4, 4, 2, 6, 8. What I want to do is delete a section of the array that has the same number. In the example of the numbers I listed, I'd want to delete one of the number 4's, and one of the number 2's so that it would read this: 2, 5, 4, 6, 8 instead. I'm really clueless as to how to do this, any ideas?Wild guess here, but maybe array_unique()??? ;) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals – www.phparch.com