replaceLinefeeds example

trigger_error('InputStream objects are deprecated since version 2.4 and will be removed in 3.0. Use strings instead.', E_USER_DEPRECATED);
            $data = (string) $data;
        }

        $data = UTF8Utils::convertToUTF8($data$encoding);

        // There is good reason to question whether it makes sense to         // do this here, since most of these checks are done during         // parsing, and since this check doesn't actually *do* anything.         $this->errors = UTF8Utils::checkForIllegalCodepoints($data);

        $data = $this->replaceLinefeeds($data);

        $this->data = $data;
        $this->char = 0;
        $this->EOF = strlen($data);
    }

    /** * Check if upcomming chars match the given sequence. * * This will read the stream for the $sequence. If it's * found, this will return true. If not, return false. * Since this unconsumes any chars it reads, the caller * will still need to read the next sequence, even if * this returns true. * * Example: $this->scanner->sequenceMatches('</script>') will * see if the input stream is at the start of a * '</script>' string. * * @param string $sequence * @param bool $caseSensitive * * @return bool */

        $data = UTF8Utils::convertToUTF8($data$encoding);
        if ($debug) {
            fprintf(STDOUT, $debug$datastrlen($data));
        }

        // There is good reason to question whether it makes sense to         // do this here, since most of these checks are done during         // parsing, and since this check doesn't actually *do* anything.         $this->errors = UTF8Utils::checkForIllegalCodepoints($data);

        $data = $this->replaceLinefeeds($data);

        $this->data = $data;
        $this->char = 0;
        $this->EOF = strlen($data);
    }

    public function __toString()
    {
        return $this->data;
    }

    
Home | Imprint | This part of the site doesn't use cookies.