protected function getProviders($body = '')
    {
        $regex = ($this->config['use_embed_prefix'] === true ? $this->urlEmbedRegex : $this->urlRegex);
        if (is_array($body)) {

            $body = array_filter($body, function ($arr) use ($regex) {
                return preg_match($regex, $arr);
            });

            $services = $this->providers->getAll($body);
        } elseif (preg_match_all($regex, $body, $matches)) {
            $services = $this->providers->getAll($matches['0']);
        } else {
            return array();
        }

        return $this->clean($services);
    }
protected function getProviders($body = '')
    {
        $regex = ($this->config['use_embed_prefix'] === true ? $this->urlEmbedRegex : $this->urlRegex);
        if (is_array($body)) {

            $body = array_filter($body, function ($arr) use ($regex) {
                return preg_match($regex, $arr);
            });

            $services = $this->providers->getAll($body);
        } elseif (preg_match_all($regex, $body, $matches)) {
            $services = $this->providers->getAll($matches['0']);
        } else {
            return array();
        }

        return $this->clean($services);
    }
protected function getProviders ( $ body = '' ) { $ regex = ( $ this -> config [ 'use_embed_prefix' ] === true ? $ this -> urlEmbedRegex : $ this -> urlRegex ) ; if ( is_array ( $ body ) ) { $ body = array_filter ( $ body , function ( $ arr ) use ( $ regex ) { return preg_match ( $ regex , $ arr ) ; } ) ; $ services = $ this -> providers -> getAll ( $ body ) ; } elseif ( preg_match_all ( $ regex , $ body , $ matches ) ) { $ services = $ this -> providers -> getAll ( $ matches [ '0' ] ) ; } else { return array ( ) ; } return $ this -> clean ( $ services ) ; }
Finds all the valid urls inside the given text,
compares which are allowed and returns an array
with the detected providers

@param null|string|array $body An array or string with Urls
@return array
Finds all the valid urls inside the given text compares which are allowed and returns an array with the detected providers