@param $content

@return bool|array
169942
protected function getImages($content)
    {
        $images = array();

        $dom = $this->createDOM($content);
        if (!$dom) {
            return $images;
        }

        $domList = $dom->getElementsByTagName('img');

        foreach ($domList as $image) {
            $imageSrc = $image->getAttribute('src');

            if (!$imageSrc) {
                continue;
            }
            $images[] = $imageSrc;
        }

        return $images;
    }
1266573
public function detect($content)
    {
        if ($content == '') {
            return [];
        }

        $data = json_decode($content, true);

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw ErrorException::invalidResponse(json_last_error_msg(), json_last_error());
        }

        if (!empty($data['code'])) {
            throw ErrorException::failed(
                isset($data['message']) ? $data['message'] : '',
                $data['code']
            );
        }

        return (array) $data;
    }
931948
public function contentParser($content)
    {
        return str_replace(['{{dataApiUrl}}', '{{title}}', '{{template}}'], [$this->getDataApiUrl(), $this->getTitle(), $this->_template], $content);
    }
1186340
private static function isValid(string $content): bool
    {
        if ('' === $content) {
            return false;
        }

        return (bool)preg_match_all(static::getPlaceholderPattern(), $content);
    }
575406
protected static function normalizeArray(array $content)
    {
        foreach ($content as $key => $value) {
            if ($value instanceof \SimpleXMLElement) {
                if ($value->count()) {
                    $content[$key] = static::normalizeArray((array) $value);
                } else {
                    $content[$key] = null;
                }
            } elseif (is_array($value)) {
                $content[$key] = static::normalizeArray($value);
            }
        }

        return $content;
    }
893269
public function parse($content)
    {
        // if there is no path it's not needed to try to get a clean one
        if (empty($content)) return [];

        $path = $this->getCleanPath($content);
        $pathParts = [$this->delimiter];
        // check if there is even a need for further checks
        if (mb_strpos($path, $this->delimiter) === false) {
            if (!$path) {
                return [$this->delimiter];
            }

            // set the root and the path
            $tmpPathParts = [
                $this->delimiter,
                $path
            ];

            return $tmpPathParts;
        }

        // if there's a deeper path it's time to walk through it and clean the empty parts etc
        $tmpPathParts = explode($this->delimiter, $path);


        // walk through the array and remove the empty entries
        for ($i = 0, $c = count($tmpPathParts); $i < $c; $i++) {
            if (!$tmpPathParts[$i]) unset($tmpPathParts[$i]);
        }

        // prepend the default delimiter
        $pathParts = array_merge($pathParts, $tmpPathParts);

        // path parts
        return $pathParts;
    }
920896
public function compile($content)
    {
        if( ! $this->count()) return $content;

        $pattern = $this->getRegex();

        return preg_replace_callback("/{$pattern}/s", [&$this, 'render'], $content);
    }
1294633
public static function get_content_value($content) {
        $arr = explode('##', $content->content);

        $strvalue = '';
        foreach ($arr as $a) {
            $strvalue .= $a . ' ';
        }

        return trim($strvalue, "\r\n ");
    }
1112898
protected function re($content)
    {
        preg_match_all('/more_list">(.*?)<\/ul>/s', $content, $match_ul);
        preg_match_all('/href="(.*?)" .*?">(.*?)</s', $match_ul[1][0], $match_li);
        preg_match_all('/\[(.*?)\]/', $match_ul[1][0], $match_time);

        $list = [];
        foreach ($match_li[0] as $key => $value) {
            $list[$key]['title'] = trim(mb_convert_encoding($match_li[2][$key], 'UTF-8', 'GB2312'));
            $list[$key]['url'] = trim(Config::$config['url_index'] . $match_li[1][$key]);
            $list[$key]['time'] = trim(mb_convert_encoding($match_time[1][$key], 'UTF-8', 'GB2312'));
        }
        return $list;
    }
1227489
public function getResponse($content = '')
    {
        //transform content by content type
        if ($this->isJsonRequest()) {
            if ($content instanceof Response\JsonResponse) {
                $content = json_decode($content->getBody());
            } elseif (!is_array($content)) {
                $content = [$content];
            }
        } else {
            if (is_array($content)) {
                $content = implode('', $content);
            } elseif ($content instanceof ResponseInterface) {
                $content = $content->getBody()->__toString();
            }
        }

        if (!$this->getContainer()->has(ResponseInterface::class)) {
            if ($this->isCli()) {
                $class = Response\TextResponse::class;
            } elseif ($this->isJsonRequest()) {
                $class = Response\JsonResponse::class;
            } else {
                $class = Response\HtmlResponse::class;
            }
            $this->getContainer()->add(ResponseInterface::class, $class);
        }

        /** @var ResponseInterface $response */
        $response = $this->validateContract($this->getContainer()->get(ResponseInterface::class, [$content]),
            ResponseInterface::class);

        //inject request content type
        $request = $this->getRequest();

        $contentTypeKey = 'content-type';
        foreach ($request->getHeader($contentTypeKey) as $contentType) {
            $response = $response->withHeader($contentTypeKey, $contentType);
        }

        return $response;
    }
367077
public function decode_content($content) {
        if (!$content = $this->precheck_content($content)) { // Perform some prechecks
            return false;
        }
        // Iterate over all rules, chaining results
        foreach ($this->rules as $rule) {
            $content = $rule->decode($content);
        }
        return $content;
    }
278295
public function parseContent($content) {
        $dc = json_decode($content, true);

        $ret = [];

        foreach ($dc as $key => $content) {
            preg_match("/^(?P<type>[a-z0-9A-Z]*):(?P<path>(?P<id>[a-z0-9A-Z]*):(?P<field>[a-z0-9A-Z]*))$/", $key, $matches);

            $ret[] = [
                'type' => $matches['type'],
                'path' => $matches['path'],
                'id' => $matches['id'],
                'field' => $matches['field'],
                'content' => $content
            ];
        }

        return $ret;
    }
954953
public function setContent( $content )
	{
		if( $this->content === (string) $content )
			return FALSE;
		$this->content = (string) $content;
		return TRUE;
	}
334642
public function isAsset(Content $content): bool
    {
        if ($this->contentTypeId === null) {
            $contentType = $this->contentTypeService->loadContentTypeByIdentifier(
                $this->mappings['content_type_identifier']
            );

            $this->contentTypeId = $contentType->id;
        }

        return $content->contentInfo->contentTypeId === $this->contentTypeId;
    }
115553
public function getFunctions(string $content): array
    {

        $functions = array();

        $tokenised_content = $this->getTokenisedContent($content);

        // Check for $tokenised_content["methods"];
        if (isset($tokenised_content["methods"])) {
            $functions = $tokenised_content["methods"];
        } elseif (isset($tokenised_content["functions"])) {
            $functions = $tokenised_content["functions"];
        }

        return $functions;

    }
1091668
public static function getArrayKeys($content)
    {
        preg_match_all(self::ARRAY_KEYS_REGEX, trim($content), $matches);

        return !empty($matches) ? $matches[1] : array();
    }
1016051
public function getShortcodesFromContent($content)
    {
        $content = $this->getContentWithoutIgnoreBlocks($content);

        if (false === strpos($content, '[')) {
            return [];
        }

        $result = [];

        $regex = "\[([A-Za-z_]+[^\ \]]+)";
        preg_match_all('/' . $regex . '/', $content, $matches);

        if (!empty($matches[1])) {
            foreach ($matches[1] as $match) {
                $result[$match] = $match;
            }
        }

        if ($result) {
            return array_keys($result);
        }

        return $result;
    }