Re: highlight_file() in XHTML Strict?

From: Date: Tue, 24 Jun 2003 11:41:00 +0000
Subject: Re: highlight_file() in XHTML Strict?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-152590@lists.php.net to get a copy of this message
try this: ob_start(); $oldlevel=error_reporting(0); highlight_file($file); error_reporting($oldlevel); $buffer = ob_get_contents(); ob_end_clean(); $buffer = str_replace("<code>", "", $buffer); $buffer = str_replace("</code>", "", $buffer); $buffer = preg_replace("/<font color=\"([^\"]*)\">/i","<span style=\"color: \\1\">",str_replace("</font>","</span>",$buffer)); echo $buffer; > I want to use highlight_file() in XHTML Strict. Is there any way to > change PHP to use <span class="string"> (and other classes) and use a > stylesheet to colour it? If not, any other suggestions?

« previous php.general (#152590) next »