Jump to content


Photo

PHP Syntax Colouring Script


  • Please log in to reply
3 replies to this topic

#1 Gast

Gast
  • Members
  • PipPipPip
  • Advanced Member
  • 131 posts
  • LocationSouth East England

Posted 16 March 2006 - 09:11 PM

Does anyone know where I can find a script that will highlight PHP code actually through PHP. I am not that good at regular expressions and I have seen these done before?

TIA
OS and Internet Specs:
Windows XP (with SP2), 1680x1050, PHP 4, MySQL 3, Internet Explorer 6 &7 /FireFox 2.0/Opera 9.2

Tutorials:
Simple Introduction to AJAX and XMLHttpRequest
Creating Live Data with AJAX Making a Google Suggest like application

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 16 March 2006 - 09:13 PM

[!--quoteo(post=355668:date=Mar 16 2006, 09:11 PM:name=Gast)--][div class=\'quotetop\']QUOTE(Gast @ Mar 16 2006, 09:11 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Does anyone know where I can find a script that will highlight PHP code actually through PHP. I am not that good at regular expressions and I have seen these done before?

TIA
[/quote]

<?PHP 

function showsource ($code) 
{ 
ob_start(); 
highlight_string($code); 
$colorsource = ob_get_contents(); 
ob_end_clean(); 

$colorsource = str_replace ("?", " ", $colorsource); 

return $colorsource; 
} 

?> 

good luck.


Advance php solution

[a href=\"http://www.sitepoint.com/article/highlight-source-code-php\" target=\"_blank\"]http://www.sitepoint.com/article/highlight-source-code-php[/a]
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 Gast

Gast
  • Members
  • PipPipPip
  • Advanced Member
  • 131 posts
  • LocationSouth East England

Posted 16 March 2006 - 09:33 PM

Thank you very much... :)
OS and Internet Specs:
Windows XP (with SP2), 1680x1050, PHP 4, MySQL 3, Internet Explorer 6 &7 /FireFox 2.0/Opera 9.2

Tutorials:
Simple Introduction to AJAX and XMLHttpRequest
Creating Live Data with AJAX Making a Google Suggest like application

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 16 March 2006 - 09:36 PM

[!--quoteo(post=355681:date=Mar 16 2006, 09:33 PM:name=Gast)--][div class=\'quotetop\']QUOTE(Gast @ Mar 16 2006, 09:33 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Thank you very much... :)
[/quote]

anytime
good luck
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users