Re: writing php output to a file

From: Date: Thu, 12 Oct 2000 10:29:48 +0000
Subject: Re: writing php output to a file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-19789@lists.php.net to get a copy of this message
UCT Student - WTSMEG002 wrote: > > Hi > > I've been trying to write the data that my php program outputs to a > separate file, but can't seem to do it. I've been using fread and > fwrite. It writes to a file but it writes out the php script rather than > the output from the script. Is there a way to get it to write the output > of the script instead of the script itself? > > Thankyou > Megan > I got this from Sebastian "php Hacker" Bergmann last monday. It is what you need. > Can anyone tell me how to save the outputted HTML code from a php page? <?php ob_start() ?> <!-- html --> <?php // other php code ?> <!-- html --> <?php $output = ob_get_contents(); ob_end_clean(); // do what you want with $content ?> -- <?php $a=explode(" " ,"119 130 128 129 45 110 123 124 129 117 114 127 45 ". "125 117 125 45 117 110 112 120 114 127");for($i=0;$i<sizeof($a);$i++)print chr($a[$i]-13); // http://sb.phpOpenTracker.de | mail: sbergmann@php.net ?> -- Stefan - Zipkid - Goethals YourNet - Open source web design & Site management. http://www.yournet.be mailto:stefan@yournet.be

« previous php.general (#19789) next »