|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-09-14 19:40 UTC] jeroen@php.net
[2001-09-14 19:42 UTC] jeroen@php.net
[2002-01-24 01:29 UTC] james at ractive dot ch
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
array_unique() always returns only 1 result for multi-dimentional arrays Here is the code: $temp = Array ( Array('a', 'b'), Array('x', 'y'), ); print_r($temp); print_r(array_unique($temp)); Here is the result in PHP 4.0.4, as it should be, i.e. no array change: Array ( [0] => Array ( [0] => a [1] => b ) [1] => Array ( [0] => x [1] => y ) ) Array ( [0] => Array ( [0] => a [1] => b ) [1] => Array ( [0] => x [1] => y ) ) Here is the result in PHP 4.0.6: Array ( [0] => Array ( [0] => a [1] => b ) [1] => Array ( [0] => x [1] => y ) ) Array ( [0] => Array ( [0] => a [1] => b ) ) I have put the code at http://www.99servers.com/develop/test/array_unique.php, you can see the results by yourself. My phpinfo() is located at http://www.99servers.com/develop/test/phpinfo.php, just in case you need additional details about my php 4.0.6 configuration.