you could do something like this
$buffer = '';
$fd = fopen($filename, 'r');
while (!feof($fd)) {
$buffer .= fgets($fd, 4096);
}
fclose($fd);
a better option would probably be to make your "text"
file a "php" file and echo your value where you want
them
<?
// php code here
include 'mytemplate.php';
?>
note: whatever you include will be parsed if it has
php tags, regardless of the file extension
olinux
--- Matt Palermo <[EMAIL PROTECTED]> wrote:
> I have text a file which contains php code. I am
> using it as a template for some other pages. I want
> to take everything in that file and store it in a
> string or array and then output it all to an empty
> file (this will make both files look exactly the
> same). I am using the file_get_contents() function
> to do this, but it seems to have trouble because it
> looks like it is trying to execute the php code in
> the file I am trying to get. Anyone know of a
> better way to go about this? Thanks.
>
> Matt
>
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php