<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
				<title>Comments on: Using array_unique() with multidimensional arrays</title>
		<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html</link>
		<description>Using array_unique() with multidimensional arrays Comment Feed</description>
				<language>de</language>
		<pubDate>Thu, 09 Sep 2010 19:26:59 +0000</pubDate>
		<generator>mcw[blog] 'Ruby' Alpha 3</generator>
		<item>
			<title>Comment #1 by: Peter Rother</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment278</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment278</guid>
			<author>Peter Rother</author>			
			<pubDate>Mon, 09 Feb 2009 16:45:06 +0000</pubDate>
			<content:encoded><![CDATA[ Nice example, thx. I think i can use it in future projects. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #2 by: Lorem</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment400</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment400</guid>
			<author>Lorem</author>			
			<pubDate>Tue, 24 Feb 2009 14:42:40 +0000</pubDate>
			<content:encoded><![CDATA[ Did you fill in a bug report? This is really bad behavior. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #3 by: Jeremy</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment505</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment505</guid>
			<author>Jeremy</author>			
			<pubDate>Tue, 10 Mar 2009 20:45:33 +0000</pubDate>
			<content:encoded><![CDATA[ Thank you.  Clear, concise, fast.  Works fantastic.  Well done and thanks again. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #4 by: Dominik Jungowski</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment521</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment521</guid>
			<author>Dominik Jungowski</author>			
			<pubDate>Fri, 13 Mar 2009 09:57:14 +0000</pubDate>
			<content:encoded><![CDATA[ @Lorem: I just did (although there was already a similar bug report from 2001): http://bugs.php.net/bug.php?id=47642 ]]></content:encoded>
		</item>
		<item>
			<title>Comment #5 by: Frank</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment1094</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment1094</guid>
			<author>Frank</author>			
			<pubDate>Mon, 04 May 2009 22:29:53 +0000</pubDate>
			<content:encoded><![CDATA[ I need a fix for this as I've stumbled across this bug today. Unfortunately, your code outputs the exact same result as array_unique(). ]]></content:encoded>
		</item>
		<item>
			<title>Comment #6 by: Dominik Jungowski</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment1100</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment1100</guid>
			<author>Dominik Jungowski</author>			
			<pubDate>Tue, 05 May 2009 07:34:51 +0000</pubDate>
			<content:encoded><![CDATA[ An example where it puts out the same would be nice.<br />
<br />
As for the example from the blogpost: I have just tested it once more and it worked as it should.<br />
<br />
btw. the bug report was closed ("was never intended to work with multi-dimensional arrays") but at least the documentation has been updated ]]></content:encoded>
		</item>
		<item>
			<title>Comment #7 by: Dominik Jungowski</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment1857</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment1857</guid>
			<author>Dominik Jungowski</author>			
			<pubDate>Fri, 12 Jun 2009 14:46:32 +0000</pubDate>
			<content:encoded><![CDATA[ There was indeed one bug when using associative arrays. For that reason I updated the blogpost and added the preserveKeys parameter to the function. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #8 by: zeromatrix</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment7308</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment7308</guid>
			<author>zeromatrix</author>			
			<pubDate>Sun, 15 Nov 2009 00:05:05 +0000</pubDate>
			<content:encoded><![CDATA[ Thank you very much for this knowledge. After Change the PHP version 4 to 5 my old code are not workin correct, but this works very fine !! ]]></content:encoded>
		</item>
		<item>
			<title>Comment #9 by: </title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment8664</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment8664</guid>
			<author></author>			
			<pubDate>Thu, 17 Dec 2009 06:43:24 +0000</pubDate>
			<content:encoded><![CDATA[ awesome - this rocks!  and so do you!! ]]></content:encoded>
		</item>
		<item>
			<title>Comment #10 by: Mukul</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment10886</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment10886</guid>
			<author>Mukul</author>			
			<pubDate>Fri, 12 Feb 2010 12:12:29 +0000</pubDate>
			<content:encoded><![CDATA[ Thanks for this piece of code&#8230; ]]></content:encoded>
		</item>
		<item>
			<title>Comment #11 by: John Flynn</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment11726</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment11726</guid>
			<author>John Flynn</author>			
			<pubDate>Mon, 01 Mar 2010 19:03:27 +0000</pubDate>
			<content:encoded><![CDATA[ I have borrowed this functionality and left credit in the comments.  Good idea.  Thanks! ]]></content:encoded>
		</item>
		<item>
			<title>Comment #12 by: Christian</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment13870</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment13870</guid>
			<author>Christian</author>			
			<pubDate>Fri, 30 Apr 2010 14:04:47 +0000</pubDate>
			<content:encoded><![CDATA[ AWESOME CODE!!!! Real cool! Thx thx thx! ]]></content:encoded>
		</item>
		<item>
			<title>Comment #13 by: Christian</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment13874</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment13874</guid>
			<author>Christian</author>			
			<pubDate>Fri, 30 Apr 2010 16:03:16 +0000</pubDate>
			<content:encoded><![CDATA[ Is this function working with arrays of any size? Although it worked fine with smaller ones (a few hundred entries), it didn't seem to work with an array with 5500 entries as the resulting array was still the same size (and there are lots of duplicates in there). The smaller ones I tested it with were actually parts of this big one.<br />
<br />
Not sure if it's a function limit or some other server/PHP limitation.<br />
<br />
Christian ]]></content:encoded>
		</item>
		<item>
			<title>Comment #14 by: Dominik Jungowski</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment13877</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment13877</guid>
			<author>Dominik Jungowski</author>			
			<pubDate>Fri, 30 Apr 2010 18:51:27 +0000</pubDate>
			<content:encoded><![CDATA[ Well, I haven't tested it with a array that large so far, but I can take a look at it and see what results I get. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #15 by: Christian</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment13925</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment13925</guid>
			<author>Christian</author>			
			<pubDate>Sun, 02 May 2010 10:11:27 +0000</pubDate>
			<content:encoded><![CDATA[ FYI: My array with 5500 entries is actually one of the smaller ones. The biggest one contains 110.000 entries. Support for that size would be much appreciated! ;) ]]></content:encoded>
		</item>
		<item>
			<title>Comment #16 by: </title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment14238</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment14238</guid>
			<author></author>			
			<pubDate>Fri, 14 May 2010 09:30:12 +0000</pubDate>
			<content:encoded><![CDATA[ Thanks, it solved my problem also in minutes, great work! ]]></content:encoded>
		</item>
		<item>
			<title>Comment #17 by: Dominik Jungowski</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment14252</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment14252</guid>
			<author>Dominik Jungowski</author>			
			<pubDate>Fri, 14 May 2010 15:18:37 +0000</pubDate>
			<content:encoded><![CDATA[ @Michael: I haven't had the time yet to check out your problem, but I will do it soon! ]]></content:encoded>
		</item>
		<item>
			<title>Comment #18 by: KingIsulgard</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment15705</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment15705</guid>
			<author>KingIsulgard</author>			
			<pubDate>Wed, 14 Jul 2010 13:43:58 +0000</pubDate>
			<content:encoded><![CDATA[ This is really bad coding. I wouldn't use it. This code can be so much more efficient.<br />
<br />
I wrote this code. It has the option to preserve keys, but default is non preserving keys. It is an optional parameter.<br />
<br />
function arrayUnique($array, $preserveKeys = false) {<br />
			$newArray = array();<br />
			$newKeys = array();<br />
			<br />
			// Add items to new array and remove doubles<br />
			foreach($array as $key => $item) {<br />
				$newArray[serialize($item)] = $item;<br />
				$newKeys[] = $key;<br />
			}<br />
			<br />
			// Set keys<br />
			if($preserveKeys) {<br />
				array_combine($newKeys, $newArray);<br />
			} else {<br />
				$newArray = array_values($newArray);<br />
			}<br />
			<br />
			return $newArray;<br />
		} ]]></content:encoded>
		</item>
		<item>
			<title>Comment #19 by: Achin Sharma</title>
			<link>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment17340</link>
			<guid>http://www.phpdevblog.net/2009/01/using-array-unique-with-multidimensional-arrays.html#comment17340</guid>
			<author>Achin Sharma</author>			
			<pubDate>Mon, 23 Aug 2010 13:28:10 +0000</pubDate>
			<content:encoded><![CDATA[ hmm cool script but somehow it didnt work for me.. alas i am kind of stuck at this.. ]]></content:encoded>
		</item>
		</channel>
</rss>