Forum Moderators: coopster

Message Too Old, No Replies

Unique Array

Multidimension arrays trimmed down.

         

kieftrav

5:28 am on Sep 23, 2006 (gmt 0)

10+ Year Member



Hey everyone. Here's the structure of my array:

Array
( [0] Array
[A] Blah, Blah
[B] blah, blah
[1] Array
[A] Different
[B] Also different
[2] Array
[A] Blah, Blah
[B] blah, blah
)

Please excuse lack of proper syntax... But that is the structure. What I want to do is check and make the array unique so that each Value help by A/B is unique. If I was to perform the uniqueness thing on the above array, I would receive the first array with values 0 & 1, but not 2 because A & B repeat the values of 0 A & B...

Anyone got any ideas? Is there some way to use the array_unique function?

Thanks,
Travis

Psychopsia

6:08 am on Sep 23, 2006 (gmt 0)

10+ Year Member



It could work with array_flip [us3.php.net] .

PHP Manual:


If a value has several occurrences, the latest key will be used as its values, and all others will be lost.

kieftrav

5:27 am on Sep 25, 2006 (gmt 0)

10+ Year Member



Thanks psychopsia, worked like a charm.

Travis