note 43272 added to function.array-unique
| From: | wernerlistas at terra dot com dot br | Date: | Wed, 16 Jun 2004 12:50:30 +0000 |
| Subject: | note 43272 added to function.array-unique | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-71142@lists.php.net to get a copy of this message | ||
Following the code copies of a little function I've wrote that actually works with
multidimensional arrays.
It also resets the array indexes.
if ( !function_exists( "arrayUnique" ) ){
function arrayUnique ( $rArray ){
$rReturn = array ();
while ( list( $key, $val ) = each ( $rArray ) ){
if ( !in_array( $val, $rReturn ) )
array_push( $rReturn, $val );
}
return $rReturn;
}
}
----
Manual Page -- http://www.php.net/manual/en/function.array-unique.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43272
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43272&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43272&report=yes
Search -- http://master.php.net/manage/user-notes.php