Zend - The PHP Company




Source Viewers

Add Code


Source viewer  

Type: code fragment
Added by: inter
Entered: 06/07/2000
Last modified: 08/12/1999
Rating: - (fewer than 3 votes)
Views: 7864
View the source of a program
  • Change the html () to html :-)


<?
 
/*
           -=- Source function -=-
      
            Gemaakt door: Ivo Koster
              Gemaakt op: 06-07-2000
     Laast bijgewerkt op: 06-07-2000
                  Versie: 0.1
    (C)2000 Ivo Koster, Exed.
  */

function source($source)

  
clearstatcache();                              // cache of the filething dele.
  
if(!file_exists($source))                      // Checking for the file $source.
  
{
    return 
1;
  }
 
  
$src =fopen($source,"r");
  
$test fread ($srcfilesize($source));       // Read the file
  
$test htmlentities($test);                   // make all the html entry's work
  
$test str_replace(" ","&nbsp;",$test);       // make the " " to &nbsp;
  
$test nl2br($test);                          // make the /n to <BR>
  
echo $test;                                    // test it out
  
fclose($src);
  return 
0;
}

source($source);
?>


Usage Example


source.php3?source=../test.php
source.php3?source=../test.html
source.php3?source=../test.shtml
or use it in as a funtion


Rate This Script





Search



This Category All Categories