PageRenderTime 307ms CodeModel.GetById 141ms app.highlight 7ms RepoModel.GetById 155ms app.codeStats 0ms

/wp-content/plugins/ad-codez-widget/includes/classes/utils-arrays.inc.php

https://bitbucket.org/Wallynm/iptb
PHP | 46 lines | 30 code | 0 blank | 16 comment | 4 complexity | 22addd3ff42388029b0052d5f4a0d4f6 MD5 | raw file
 1<?php
 2/*
 3Copyright: Š 2009 WebSharks, Inc. ( coded in the USA )
 4<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
 5
 6Released under the terms of the GNU General Public License.
 7You should have received a copy of the GNU General Public License,
 8along with this software. In the main directory, see: /licensing/
 9If not, see: <http://www.gnu.org/licenses/>.
10*/
11if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
12	exit ("Do not access this file directly.");
13/**/
14if (!class_exists ("c_ws_widget__ad_codes_utils_arrays"))
15	{
16		class c_ws_widget__ad_codes_utils_arrays
17			{
18				/*
19				Function that extends array_unique to support multi-dimensional arrays.
20				*/
21				public static function array_unique ($array = FALSE)
22					{
23						if (!is_array ($array))
24							{
25								return array ($array);
26							}
27						else /* Serialized array_unique. */
28							{
29								foreach ($array as &$value)
30									{
31										$value = serialize ($value);
32									}
33								/**/
34								$array = array_unique ($array);
35								/**/
36								foreach ($array as &$value)
37									{
38										$value = unserialize ($value);
39									}
40								/**/
41								return $array;
42							}
43					}
44			}
45	}
46?>