Re: fread()

From: Date: Mon, 21 Feb 2005 10:54:07 +0000
Subject: Re: fread()
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38626@lists.php.net to get a copy of this message
u'll get actual the _contents_ of the file, not the 'html content'. so even if it's a .php, u'll get it's source...it wouldn't be parsed by the webserver. it'd be like "cat /usr/local/something.php" (as long as the web server running ur script has read access to the file). if it's not a local file, the target web server will parse it and then u'd get the html content, if any. u may want to check out file_get_contents (PHP 4 >= 4.3.0, PHP 5) file_get_contents -- Reads entire file into a string http://www.php.net/manual/en/function.file-get-contents.php On Mon, 21 Feb 2005 02:12:37 -0800 (PST), Yemi Obembe <fickledreams@yahoo.com> wrote: > Hi All, > I'd just like to know if it is possible to use fread to read the html content of a > serverside coded page....as in something like this: > > <?php > $filename = "/usr/local/something.php"; > $handle = fopen($filename, "r"); > $contents = fread($handle, filesize($filename)); > fclose($handle); > ?> -- ]# Anirudh Dutt ...pilot of the storm who leaves no trace like thoughts inside a dream

« previous php.db (#38626) next »