note 87817 rejected from function.file-get-contents by danbrown
| From: | danbrown@php.net | Date: | Fri, 26 Dec 2008 17:05:19 +0000 |
| Subject: | note 87817 rejected from function.file-get-contents by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148547@lists.php.net to get a copy of this message | ||
Note Submitter: akshay dot raje at gmail dot com
----
I am facing an issue with file_get_contents() and am not able to reason with it.
file.txt contains the following text:
background = "$FPG_bgcolor"
My php code is as follows:
<?php
$FPG_bgcolor = "#FFFFFF";
$FPG_template = file_get_contents('file.txt');
echo "$FPG_template";
?>
In the output, $FPG_template is not replaced with #FFFFFF. However, if i put all the contents of
file.txt as a string variable in my code, it all works fine.