Re: Opening a file to manipulate it

From: Date: Sun, 17 Nov 2002 08:27:44 +0000
Subject: Re: Opening a file to manipulate it
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-124778@lists.php.net to get a copy of this message
Hi, on 17/11/02 1:45 PM, Troy May (tmay@pcsympathy.com) wrote: > <? $header = fopen("header.html","r"); > > echo $header; ?> > > It writes "Resource id #1" at the top of the page. What is that?! :) You're missing some code -- instead, try this example from the fread() page in the manual: <?php // get contents of a file into a string $filename = "header.html"; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename)); fclose ($fd); ?> Cheers, Justin French -------------------- http://Indent.com.au Web Developent & Graphic Design --------------------

« previous php.general (#124778) next »