src/SitemapParser.php
protected function parseString($string)
    {
        if (!isset($this->config['strict']) || $this->config['strict'] !== false) {
            // Strings are not part of any documented sitemap standard
            return false;
        }
        $array = array_filter(array_map('trim', mb_split('\r\n|\n|\r', $string)));
        foreach ($array as $line) {
            if ($this->isSitemapURL($line)) {
                $this->addArray(self::XML_TAG_SITEMAP, ['loc' => $line]);
                continue;
            }
            $this->addArray(self::XML_TAG_URL, ['loc' => $line]);
        }
        return true;
    }
protected function parseString($string)
    {
        if (!isset($this->config['strict']) || $this->config['strict'] !== false) {
            // Strings are not part of any documented sitemap standard
            return false;
        }
        $array = array_filter(array_map('trim', mb_split('\r\n|\n|\r', $string)));
        foreach ($array as $line) {
            if ($this->isSitemapURL($line)) {
                $this->addArray(self::XML_TAG_SITEMAP, ['loc' => $line]);
                continue;
            }
            $this->addArray(self::XML_TAG_URL, ['loc' => $line]);
        }
        return true;
    }
protected function parseString ( $ string ) { if ( ! isset ( $ this -> config [ 'strict' ] ) || $ this -> config [ 'strict' ] !== false ) { // Strings are not part of any documented sitemap standard return false ; } $ array = array_filter ( array_map ( 'trim' , mb_split ( '\r\n|\n|\r' , $ string ) ) ) ; foreach ( $ array as $ line ) { if ( $ this -> isSitemapURL ( $ line ) ) { $ this -> addArray ( self :: XML_TAG_SITEMAP , [ 'loc' => $ line ] ) ; continue ; } $ this -> addArray ( self :: XML_TAG_URL , [ 'loc' => $ line ] ) ; } return true ; }
Parse line separated text string

@param string $string
@return bool
Parse line separated text string