/is', '', $html); $html = preg_replace('/<\/body>.*?$/is', '', $html); return $html; } /** * Change HTML markup to HTML5 * * @param string $html HTML markup to be cleaned * @return string */ protected static function changeHtmlToHtml5($html) { // Delete obsolete attributes $html = preg_replace('#\s(cellpadding|border|width)="[^"]+"#', '', $html); // Replace font tag with span return str_replace([''], [''], $html); } }