src/Arrays/ArrayUtil.php
public function filterByPrefixes(array $data = [], $prefixes = [])
    {
        $extract = [];

        if (!\is_array($prefixes) || empty($prefixes)) {
            return $data;
        }

        foreach ($data as $key => $value) {
            foreach ($prefixes as $prefix) {
                if ($this->container->get('huh.utils.string')->startsWith($key, $prefix)) {
                    $extract[$key] = $value;
                }
            }
        }

        return $extract;
    }
public function filterByPrefixes(array $data = [], $prefixes = [])
    {
        $extract = [];

        if (!\is_array($prefixes) || empty($prefixes)) {
            return $data;
        }

        foreach ($data as $key => $value) {
            foreach ($prefixes as $prefix) {
                if ($this->container->get('huh.utils.string')->startsWith($key, $prefix)) {
                    $extract[$key] = $value;
                }
            }
        }

        return $extract;
    }
public function filterByPrefixes ( array $ data = [ ] , $ prefixes = [ ] ) { $ extract = [ ] ; if ( ! \ is_array ( $ prefixes ) || empty ( $ prefixes ) ) { return $ data ; } foreach ( $ data as $ key => $ value ) { foreach ( $ prefixes as $ prefix ) { if ( $ this -> container -> get ( 'huh.utils.string' ) -> startsWith ( $ key , $ prefix ) ) { $ extract [ $ key ] = $ value ; } } } return $ extract ; }
Filter an Array by given prefixes.

@param array $data
@param array $prefixes

@return array the filtered array or $arrData if $prefix is empty
Filter an Array by given prefixes .