SrtParser\srtFileEntry::stripTags PHP Метод

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

Strips Advanced SSA tags
public stripTags ( boolean $stripBasic = false, array $replacements = [] ) : boolean
$stripBasic boolean If true, , and tags will be stripped
$replacements array
Результат boolean (true if tags were actually stripped)
    public function stripTags($stripBasic = false, $replacements = array())
    {
        if ($stripBasic) {
            $this->noTagText = strip_tags($this->text);
        } else {
            $this->noTagText = $this->text;
        }
        $patterns = "/{[^}]+}/";
        $repl = "";
        $this->noTagText = preg_replace($patterns, $repl, $this->noTagText);
        if (count($replacements) > 0) {
            $this->noTagText = str_replace(array_keys($replacements), array_values($replacements), $this->noTagText);
            $this->noTagText = iconv('UTF-8', 'UTF-8//IGNORE', $this->noTagText);
        }
        return $this->text != $this->noTagText;
    }