Voting

: max(eight, zero)?
(Example: nine)

The Note You're Voting On

manithu at fahr-zur-hoelle dot org
20 years ago
This function will return highlighted, xhtml 1.1 valid code (replaces <font> with <span> elements and color with style attributes):

<?php

function xhtml_highlight($str) {
$str = highlight_string($str, true);
//replace <code><font color=""></font></code>
$str = preg_replace('#<font color="([^\']*)">([^\']*)</font>#', '<span style="color: \\1">\\2</span>', $str);
//replace other <font> elements
return preg_replace('#<font color="([^\']*)">([^\']*)</font>#U', '<span style="color: \\1">\\2</span>', $str);
}

?>

<< Back to user notes page

To Top