0

Hi,

I was wondering how you can attach everything from a html source, so all the spaces, all the tabs, newlines are gone and everything is glued togheter?

I tried with implode, but that doesn't do anything because I can't get rid of the spaces, tabs, newlines etc. Is there an easy way to achieve this?

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Kligham
1

You can try this online HTML optimizer, http://www.iwebtool.com/html_optimizer

After you've got the optimized code, you'll notice there's still some whitespace, so type this in:

<?php
$html = "HTML";
$optimized = str_replace("> <", "", $html);
echo "<code>".$optimized."</code>";
?>

I haven't tested the above PHP code, but it should work.

Edited by php?: Fixed the echo statement

0

Is it possible to let the script send the html source to the site. The site optimizes it, and then I get it back? Is there an automated way to do is?

0

IT's K, I made a optimizer myself with help from annother script =p

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.