note 41139 deleted from function.file-get-contents by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 31 Mar 2004 23:14:24 +0000 |
| Subject: | note 41139 deleted from function.file-get-contents by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-67440@lists.php.net to get a copy of this message | ||
Note Submitter: webman at php dot com dot ua
----
There's a trick...
I needed to place bare html-code into parameter of a variable, and then display it with the function
of my class. The deal was that html-code contained quotes _"_ This function is exactly what u
need in such a case.
<?
include ("page.cls"); // my template of a class
$indexpage = new Page();
// this file contains html-code with lots of quotes _"_
$newcontent = file_get_contents($_SERVER['DOCUMENT_ROOT']."data/index.dt");
// here I constantly was getting message about incorrect
// parameters (if you don't use file_get_contents();,
// but something else)
$indexpage -> SetContent("$newcontent");
$indexpage -> Display();
?>
------
it's not the best way to solve this problem! I just can afford myself to use this code. Avoide
such programming =)