SrtParser\srtFile::build PHP Метод

build() публичный Метод

Builds file content (file_content[_notag])
public build ( boolean $stripTags = false, $stripBasic = false, array $replacements = [] )
$stripTags boolean If true, {\...} tags will be stripped
$replacements array
    public function build($stripTags = false, $stripBasic = false, $replacements = array())
    {
        $buffer = $this->is_WebVTT ? "WEBVTT\r\n\r\n" : "";
        $i = 0;
        foreach ($this->subs as $key => $sub) {
            $buffer .= $i + 1 . "\r\n";
            $buffer .= $this->subs[$key]->getTimeCodeString($this->is_WebVTT) . "\r\n";
            $buffer .= $this->subs[$key]->getText($stripTags, $stripBasic, $replacements) . "\r\n";
            $buffer .= "\r\n";
            $i++;
        }
        if ($stripTags) {
            $this->file_content_notag = $buffer;
        } else {
            $this->file_content = $buffer;
        }
    }