| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/rescommittee/modules/mod_aridatatables/includes/kernel/Utils/ |
Upload File : |
<?php
/*
*
* @package ARI Framework
* @author ARI Soft
* @copyright Copyright (c) 2011 www.ari-soft.com. All rights reserved
* @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html)
*
*/
defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.');
class AriArrayHelper
{
public static function toInteger($array, $min = null, $max = null, $unique = true)
{
if (!is_array($array))
$array = array($array);
$intArray = array();
$checkMin = is_int($min);
$checkMax = is_int($max);
foreach ($array as $k => $v)
{
$i = (int)$v;
if (($checkMin && $i < $min) ||
($checkMax && $i > $max))
continue ;
$intArray[$k] = $i;
}
if ($unique)
$intArray = array_unique($intArray);
return $intArray;
}
public static function walkRecursive(&$data, $callback)
{
if (!is_array($data) || count($data) == 0 || empty($callback))
return ;
foreach ($data as $key => $value)
{
if (!is_array($value))
$data[$key] = call_user_func_array($callback, array($value));
else
self::walkRecursive($data[$key], $callback);
}
}
}