@param   array  $array
@param   string $value
@param   mixed  $defaultValue

@return  int|string|mixed
345569
public function getKey(array $array, string $value, $defaultValue = null)
    {
        foreach ($array as $key => $nextValue) {
            if (strcasecmp($nextValue, $value) == 0) {
                return $key;
            }
        }

        return $defaultValue;
    }
1204472
public function setDefaultValue($defaultValue): FieldInterface
    {
        if (!is_array($defaultValue)) {
            throw new \InvalidArgumentException(
                "The default value for instances of ".
                __CLASS__." must be an array"
            );
        }

        $this->defaultValue = $defaultValue;
        return $this;
    }
1054150
protected function addDefault(array &$array, $key, $value)
    {
        if (empty($array[$key]) && !empty($value)) {
            $array[$key] = $value;
            return true;
        }
        return false;
    }
204867
private void arrayFillDefaultValue(Object arr) {
        if (null == arr)
            return;
        Class<?> clas = arr.getClass();
        Class<?> comp = Types.arrayElementType(clas);
        if ( !comp.isPrimitive() )
            if ( Types.arrayDimensions(clas) > 1 )
                for ( int i = 0; i < Array.getLength(arr); i++ )
                    arrayFillDefaultValue(Array.get(arr, i));
            else
                Arrays.fill((Object[]) arr, Primitive.unwrap(
                    Primitive.getDefaultValue(comp)));
    }
595162
public static function defaultValues(array $values, array &$array)
    {
        foreach ($values as $name => $value) {
            self::defaultValue($name, $value, $array);
        }
    }
847053
protected function & getFromArray(&$array, $keys, $default = null)
    {
        $key = array_shift($keys);
        if (!isset($array[$key])) {
            return $default;
        }

        if (empty($keys)) {
            return $array[$key];
        }

        return $this->getFromArray($array[$key], $keys, $default);
    }
270223
public static final function find(array $Source, $value, $default = null){
		return ($value = array_search($value, $Source, true)) !== false ? $value : $default;
	}
830930
public function get(array $array, $keys, $default = null)
    {
        $keys = $this->parseKeys($keys);

        if (is_array($array) && $keys) {
            $key = array_shift($keys);
            if (array_key_exists($key, $array)) {
                $value = $array[$key];
                if (!$keys) {
                    return $value;
                }

                if (is_array($value)) {
                    return $this->get($value, $keys, $default);
                }
            }
        }

        return $default;
    }
475578
private function findInArray(array $target, string $key, int $defaultIndex = 0, $defaultValue = null)
    {
        if (empty($target)) {
            return $defaultValue;
        }
        if (!empty($target[$key])) {
            return $target[$key];
        } elseif (!empty($target[$defaultIndex])) {
            return $target[$defaultIndex];
        }
        return $defaultValue;
    }
1313613
public static function pluck($array, string $key, $defaultValue = null): array
    {
        $result = [];
        if (!is_array($array)) {
            return $result;
        }

        // Extract key/path.
        $keyLast = Str::last($key, '.');
        $key = Str::removeLast($key, '.');

        // Extract data.
        if ($key !== '' && $key !== null) {
            $array = self::dataByPath($array, $key, false, []);
        }
        foreach ($array as $item) {
            $value = $defaultValue;
            if (is_object($item) && isset($item->{$keyLast})) {
                $value = $item->{$keyLast};
            } elseif (is_array($item) && isset($item[$keyLast])) {
                $value = $item[$keyLast];
            }
            $result[] = $value;
        }

        return $result;
    }
116100
public static function get(array $array, string $key = null, $default = null)
    {
        if ($key === null) {
            return $array;
        }

        if ($array === []) {
            return $default;
        }

        if (isset($array[$key])) {
            return $array[$key];
        }

        foreach (\explode('.', $key) as $segment) {
            if (\is_array($array) && isset($array[$segment])) {
                $array = $array[$segment];
            } else {
                return $default;
            }
        }

        return $array;
    }
412093
public static function key($key, $array, $returnValue = false)
    {
        $isExists = array_key_exists((string)$key, (array)$array);

        if ($returnValue) {
            if ($isExists) {
                return $array[$key];
            }

            return null;
        }

        return $isExists;
    }
1214586
public static function getValue($array, $key, $default = null)
    {
        if (is_string($key)) {
            // Iterate path
            $keys = explode('.', $key);
            foreach ($keys as $key) {
                if (!isset($array[$key])) {
                    return $default;
                }
                $array = &$array[$key];
            }
            // Get value
            return $array;
        } elseif (is_null($key)) {
            // Get all data
            return $array;
        }
        return null;
    }
1074581
public static function get(array $array, $key = null, $default = null)
    {
        if ($key === null) {
            return $array;
        }

        if (isset($array[$key])) {
            return static::value($array[$key]);
        }

        foreach (explode('.', (string) $key) as $segment) {
            if (! array_key_exists($segment, $array)) {
                return static::value($default);
            }

            $array = $array[$segment];
        }

        return $array;
    }
59495
private function array_get($array, $key, $default = null)
	{
		if (is_null($key)) return $array;
		foreach (explode('.', $key) as $segment)
		{
			if ( ! is_array($array) or ! array_key_exists($segment, $array))
			{
				return $default;
			}
			$array = $array[$segment] ?: $default;
		}
		return $array;
	}
792772
public static function get(array $array, $key, $default = null)
    {
        if (strpos($key, '.') !== false) {
            $keys = explode('.', $key);
            $topKey = array_shift($keys);

            return (isset($array[$topKey])) ? static::get($array[$topKey], implode('.', $keys), $default) : $default;
        } else {
            return (isset($array[$key])) ? $array[$key] : $default;
        }
    }
659374
public function postFromArray(string $arrayName, string $key, $default = "") {
        $post = $this->_getPost();
        if (!is_array($post[$arrayName]) || !array_key_exists($key, $post[$arrayName])) {
            return $default;
        }
		$requestClass = $this->postAsRequestClass();
		$requestValues = $requestClass->value($arrayName, []);
        return $requestValues->value($key, $default);
    }