Zend - The PHP Company




Source Viewers

Add Code


Source code view with syntac higlight  

Type: code fragment
Added by: iwyrobi
Entered: 24/01/2001
Last modified: 01/12/2000
Rating: **** (7 votes)
Views: 8974
Source code view with syntac higlight using highlight_string() PHP4 function.


<? 
 
/* 
    Source code view with syntac higlight using 
    highlight_string() PHP4 function.
    by : iwyrobi [iwyrobi@yahoo.com]
  */ 

function source($source
{  
  
clearstatcache();                              
  if(!
file_exists($source))                      
  { 
        return 
1
  } 
  
$handle=fopen($source,"r"); // open source code
  
$size=filesize($source);
  
$temp=fread($handle,$size);
  echo 
"<B><FONT size=2>"
  
$colorcode=highlight_string($temp);  // give the color
  
echo "</font></b>";  
  return 
0



source("somecode.php");


Usage Example




Rate This Script





Search



This Category All Categories