Current location: Hot Scripts Forums » Programming Languages » PHP » Phphighlight


Phphighlight

Reply
  #1 (permalink)  
Old 12-21-03, 01:31 PM
AjoëlD AjoëlD is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Arrow Phphighlight

Hello, i'm looking for a php highlight script like used on this forum, i have found a few but they where not so good because they only used 2 colors ... Anyone knows where i can find this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 12-21-03, 03:24 PM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
Can you be more specific about what a highlight script is? Do you mean something that takes a php script and highlights different sections depending on what the code is?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 12-21-03, 03:41 PM
Beaver Beaver is offline
Newbie Coder
 
Join Date: Dec 2003
Location: Anaheim CA
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Check out this function: highlight_string().
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 12-21-03, 03:42 PM
AjoëlD AjoëlD is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Yes, but i already found it.
If anyone is interested in this to, here's the code :

PHP Code:

<?php 

$code
='php code comes here'
//fuctie van highlight 
function return_highlight($buffer){    
  
ob_start();    
  
highlight_string($buffer);    
  
$chaine ob_get_contents();    
  
ob_end_clean();    
  return 
$chaine;    
}    
if (isset(
$code))    
{    
  
$result=return_highlight(stripslashes($code));    
}    
?>
<?
echo "<font style=\"font-size: 11px;\" face=\"Verdana\" color=\"#000000\">\n";
echo 
"$result\n";
echo 
"</font>\n";
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 09:29 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.