[PHP] array_unique() workaround?

2001-11-14 Thread Spunk S. Spunk III
I'm working on a script that needs array_unique() but my host is using 4.0.4 and it's broken in that build. Does anyone have a good workaround for this? I can wait for my host to upgrade but if I release this code, it would be better to have the workaround... I just need a good way to check for

Re: [PHP] array_unique() workaround?

2001-11-14 Thread Stig Venaas
On Wed, Nov 14, 2001 at 09:17:03AM +0100, Spunk S. Spunk III wrote: I'm working on a script that needs array_unique() but my host is using 4.0.4 and it's broken in that build. Does anyone have a good workaround for this? I can wait for my host to upgrade but if I release this code, it would be

Re: [PHP] array_unique() workaround? SOLUTION!

2001-11-14 Thread Spunk S. Spunk III
Thanks everyone for the ideas, Here's what I came up with... I forgot to mention that I needed to preserve the original array's keys. Here is a replacement I wrote that seems to work. Let me know if you see errors in it or have improvements. function my_array_unique($somearray) {

Re: [PHP] array_unique() workaround? SOLUTION!

2001-11-14 Thread Jason G.
it seems that... $newarray = array() foreach($oldarray as $key = $value) if(! isset($newarray[$key])) $newarray[$key] = $value; -JAson Garber IonZOft.com At 10:42 AM 11/14/2001 +0100, Spunk S. Spunk III wrote: Thanks everyone for the ideas, Here's what I came up

Re: [PHP] array_unique() workaround? SOLUTION!

2001-11-14 Thread dav
Well infact you are checking equity, like my suggestion about in_array :-) Spunk S. Spunk III [EMAIL PROTECTED] ha scritto nel messaggio [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Thanks everyone for the ideas, Here's what I came up with... I forgot to mention that I needed to preserve the

Re: [PHP] array_unique() workaround? SOLUTION!

2001-11-14 Thread Andrey Hristov
:08 PM Subject: Re: [PHP] array_unique() workaround? SOLUTION! Well infact you are checking equity, like my suggestion about in_array :-) Spunk S. Spunk III [EMAIL PROTECTED] ha scritto nel messaggio [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Thanks everyone for the ideas, Here'