JUpdater/arrayUnique
From Joomla! Documentation
< API16:JUpdater
The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Multidimensional array safe unique test Borrowed from PHP.net http://au2.php.net/manual/en/function.array-unique.php
Syntax[edit]
arrayUnique($myArray)
Parameter Name | Default Value | Description |
---|---|---|
$myArray |
Defined in[edit]
libraries/joomla/updater/updater.php
Importing[edit]
jimport( 'joomla.updater.updater' );
Source Body[edit]
public function arrayUnique($myArray)
{
if (!is_array($myArray)) {
return $myArray;
}
foreach ($myArray as &$myvalue){
$myvalue=serialize($myvalue);
}
$myArray=array_unique($myArray);
foreach ($myArray as &$myvalue){
$myvalue=unserialize($myvalue);
}
return $myArray;
}
Examples[edit]
Code Examples[edit]