PHP 8.6.0 Alpha 2 available for testing

Voting

: two minus zero?
(Example: nine)

The Note You're Voting On

manithu at fahr-zur-hoelle dot org
21 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

AltStyle によって変換されたページ (->オリジナル) /