On the admin page, im writing content with the CK editor, and i echo this content on my website.
<div class="content"><?php echo $content['text']; ?></div>
I attach an image, you can see this content output source code.
How can i minify or compress this generated output? I want to get smaller page size, and faster load.
Is there any php function for this, that i can use easy?
I find some on the site, but they dont workd, or they needed php.ini config, and i dont want that.
The best solution is turning on gzip compression on server. Removing spaces and line breaks via php won't give you better result, same as using both technologies will give result 99% - gzip and 1% - removed spaces.
But you can try something like this:
If you need to remove html entities from content, and you call this "minify" use
html_entity_decode($content['text'])
this will decode &lq; and others encoded symbols to their normal state