Reputation: 5427
I'm using the following regular expression found in this post: (?<=\s)\s+(?![^<>]*)
When I do this:
echo gzencode( trim( preg_replace('/(?<=\s)\s+(?![^<>]*<\/pre>)/', '', $html) ), 9);
The spaces are replaced in all html. even inside pre tags. I need this to compress the entire page.
Upvotes: 0
Views: 723
Reputation: 2428
Try this:
echo gzencode( trim( preg_replace('/\s+(?![^<>]*<\/pre>)/', '', $html) ), 9);
=)
Upvotes: 1