Ejemplo n.º 1
0
function stripwhitespace($bff)
{
    $pzcr = 0;
    $pzed = strlen($bff) - 1;
    $rst = "";
    while ($pzcr < $pzed) {
        $t_poz_start = stripos($bff, "<textarea", $pzcr);
        if ($t_poz_start === false) {
            $bffstp = substr($bff, $pzcr);
            $temp = stripBuffer($bffstp);
            $rst .= $temp;
            $pzcr = $pzed;
        } else {
            $bffstp = substr($bff, $pzcr, $t_poz_start - $pzcr);
            $temp = stripBuffer($bffstp);
            $rst .= $temp;
            $t_poz_end = stripos($bff, "</textarea>", $t_poz_start);
            $temp = substr($bff, $t_poz_start, $t_poz_end - $t_poz_start);
            $rst .= $temp;
            $pzcr = $t_poz_end;
        }
    }
    return html_compress($rst);
}
function overkill_minify($html)
{
    $page = \Minify_HTML::minify($html);
    $page = html_compress($page);
    header('Content-Encoding: gzip');
    $page = gzencode($page, 6);
    return $page;
}