Re: syntax highlighting

From: Date: Thu, 09 Nov 2000 08:36:07 +0000
Subject: Re: syntax highlighting
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24443@lists.php.net to get a copy of this message
Here is the fix (Jer put me in the right direction - thanks!): <? ob_start(); highlight_string(stripslashes($info['articleText'])); $buffer = ob_get_contents(); ob_end_clean(); $output = $buffer; $output = str_replace('&nbsp;',' ',$output); ?> In the end you will have a syntax highlighted string to do whatever you wish with (in my instance I pass it to a function). Syntax highlighting on the fly: http://www.miester.org/articles/1 --Joe ps Jer you could have *said* something since you are sitting 5 ft away from me :o) On Thu, Nov 09, 2000 at 12:17:51AM -0800, Joe Stump wrote: > OK I've got a question: > > Is there something that will highlight a string and RETURN the highlighted > string? highlight_string() PRINTS out the highlighted string - this is NOT what > I need it to do. > > Any ideas? > > --Joe > > ================================================================================ > = Joe Stump joestump98@yahoo.com > http://www.miester.org = > ================================================================================ > "Real programmers don't comment their code. > It was hard to write, it should be hard to understand." > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net ================================================================================ = Joe Stump joestump98@yahoo.com http://www.miester.org = ================================================================================ "Real programmers don't comment their code. It was hard to write, it should be hard to understand."

« previous php.general (#24443) next »