Associative arrays: how to get rid of duplicates?
<p>I have an array:</p>

<pre><code>Array
(
    [0] =&gt; Array
        (
            [attribute_name] =&gt; Appliances
            [attribute_value] =&gt; Washer
        )

    [1] =&gt; Array
        (
            [attribute_name] =&gt; Appliances
            [attribute_value] =&gt; Dryer
        )

    [2] =&gt; Array
        (
            [attribute_name] =&gt; Appliances
            [attribute_value] =&gt; Dishwasher
        )

    [3] =&gt; Array
        (
            [attribute_name] =&gt; Appliances
            [attribute_value] =&gt; Microwave
        )

    [4] =&gt; Array
        (
            [attribute_name] =&gt; Console
            [attribute_value] =&gt; Xbox360
        )

    [5] =&gt; Array
        (
            [attribute_name] =&gt; Console
            [attribute_value] =&gt; PS3
        )
)
</code></pre>

<p>I want to produce:</p>

<pre><code>Array
(
    [0] =&gt; Array
        (
            [attribute_name] =&gt; Appliances
            [attribute_value] =&gt; Washer, Dryer, Dishwasher, Microwave
        )

    [1] =&gt; Array
        (
            [attribute_name] =&gt; Console
            [attribute_value] =&gt; Xbox360, PS3
        )
)
</code></pre>

<p>How is this achieved in PHP?</p>

<p>Here's my final code based on @andrewtweber's original solution:</p>

<p><a href="http://codepad.org/E4WFnkbc" rel="nofollow">http://codepad.org/E4WFnkbc</a></p>
