)/is', '\1UTF-8\2', $text); } $text = \Normalizer::normalize(trim($text), \Normalizer::FORM_C); static $config = [ //'clean' => true, 'hide-comments' => true, 'indent' => true, 'output-xhtml' => true, 'preserve-entities' => true, //'show-body-only' => true, 'wrap' => 0, 'input-encoding' => 'utf8', 'output-encoding' => 'utf8', 'output-bom' => false, ]; $text = tidy_repair_string($text, $config); $text = preg_replace('/