Skip to content

Tag: html

How to minify php page html output?

I am looking for a php script or class that can minify my php page html output like google page speed does. How can I do this? Answer CSS and Javascript Consider the following link to minify Javascript/CSS files: https://github.com/mrclay/minify HTML Tell Apache to deliver HTML with GZip – this generall…

How to Convert Arabic Characters to Unicode Using PHP

I want to to know how can I convert a word into unicode exactly like: http://www.arabunic.free.fr/ can anyone know how to do that using PHP considering that Arabic text may contains ligatures? thanks Edit I’m not sure what is that “unicode” but I need to have the Arabic Character in it&#8217…

Sanitizing HTML input

I’m thinking of adding a rich text editor to allow a non-programmer to change the aspect of text. However, one issue is that it’s possible to distort the layout of a rendered page if the markup is incorrect. What’s a good lightweight way to sanitize html? Answer You will have to decide betwe…

Vimeo video link regex

Anybody got the regex for vimeo video links to extract them from a pragraph for use in php? Can’t seem to find a proper one for the latest vimeo url scheme Answer As far as I can tell, the scheme is just http://vimeo.com/A_NUMBER, so try http://(www.)?vimeo.com/(d+). If you don’t need links to be …

How can I comment out PHP lines inside HTML file?

In the middle my HTML code, I have a line of PHP. now, I want to make PHP line as a comment. I tried to ues <!– –> but it seems not work for PHP. What should I do? Thanks Answer Imagine you have the following code: If you want the div to be echoed but not displayed at the