public static function filterBy($array, $index, $value) { $newArray = array(); foreach ($array as $item) { $indexValue = \UArray::getKeyValue($item, $index); if ($indexValue === $value) { $newArray[] = $item; } } return $newArray; }