private function find($origin, $segment)
    {
        $parts = explode('.', $segment);

        $array = [];

        foreach ($parts as $key => $part) {
            if ($key != 0) {
                if (isset($array[$part]) && is_array($array[$part])) {
                    $array = &$array[$part];
                }

                continue;
            }

            if (!isset($origin[$part])) {
                return null;
            }

            if (!is_array($origin[$part])) {
                return [$origin[$part]];
            }

            $array = &$origin[$part];
        }

        return $array;
    }
private function find($origin, $segment)
    {
        $parts = explode('.', $segment);

        $array = [];

        foreach ($parts as $key => $part) {
            if ($key != 0) {
                if (isset($array[$part]) && is_array($array[$part])) {
                    $array = &$array[$part];
                }

                continue;
            }

            if (!isset($origin[$part])) {
                return null;
            }

            if (!is_array($origin[$part])) {
                return [$origin[$part]];
            }

            $array = &$origin[$part];
        }

        return $array;
    }
private function find ( $ origin , $ segment ) { $ parts = explode ( '.' , $ segment ) ; $ array = [ ] ; foreach ( $ parts as $ key => $ part ) { if ( $ key != 0 ) { if ( isset ( $ array [ $ part ] ) && is_array ( $ array [ $ part ] ) ) { $ array = & $ array [ $ part ] ; } continue ; } if ( ! isset ( $ origin [ $ part ] ) ) { return null ; } if ( ! is_array ( $ origin [ $ part ] ) ) { return [ $ origin [ $ part ] ] ; } $ array = & $ origin [ $ part ] ; } return $ array ; }
Find information to the origin array

@param array $origin
@param string $segment

@return array|mixed|null
Find information to the origin array