Printing PHP Source with a PHP Script

From: Date: Mon, 15 Dec 2003 02:36:25 +0000
Subject: Printing PHP Source with a PHP Script
Groups: php.general 
Request: Send a blank email to php-general+get-172703@lists.php.net to get a copy of this message
Hi everyone, I'm trying to output PHP source within a PHP Script. The following script seems to work(Viewing HTML Source reveals the PHP Source), but the Browser output is very different. Is there a function or header I should set before echoing the PHP Source? Thanks. <? //filereader.php //script arguments: filereader.php?file= $fh = fopen($file,"rb"); $src = fread($fh,filesize($file)); fclose($fh); echo '<html><meta http-equiv="Content-Type" content="text/plain">'; echo $src; echo '</html>'; ?>

« previous php.general (#172703) next »