Making HTML XHTML Compliant with PHP

The times they are a-changin’.

This post seems to be older than 12 years—a long time on the internet. It might be outdated.

This is function I found on php.net that changes all HTML tags to lower case. You need this to make your HTML XHTML 1.0 Trans compliant.

function reformat ($content){
	$content = preg_replace("#(<\/?)(\w+)(&#91;^>]*>)#e", "''\1'.strtolower('\2').'\3'", $content);

	return $content;
}

Note: This was code that I originally had in a ‘Code’ page, but I’m moving it to a post now. This code is probably really old (years and years old). I enjoy laughing at myself and so should you.

0