Pesquisar na base de dados |
Pesquisar por categoria |
|
|
|
|
|
| Compressor HTML usando PHP |
|
Detalhes do artigo
Última atualização 11th o June, 2010
|
| Opções de usuário (0 votos) |
|
Nenhum usuário votou.
|
|
Obrigado por avaliar este artigo.
|
When we write code we love to format it nicely adding tabs, line breaks
and indentations, but the end user isn’t interested in how lovely the
source code is, they just want the page content, so this script strips
out all the line breaks and spaces in your code and puts it on one line,
compressing your code and making it faster.
<?php // start output buffer ob_start('compress_html'); ?>
<!-- all xhtml content here -->
<?php // end output buffer and echo the page content ob_end_flush();
// this function gets rid of tabs, line breaks, and white space function compress_html($compress) { $i = array('/>[^S ]+/s','/[^S ]+</s','/(s)+/s'); $ii = array('>','<','1'); return preg_replace($i, $ii, $compress); } ?>
|
| Comentários |
|
Não hpa comentários de visitantes. Comentar
|
| Artigos relacionados |
|
Não foi encontrado artigos relacionados.
|