how to assign a parsed file to a variable?
| From: | Vboy | Date: | Tue, 27 Jun 2000 00:48:57 +0000 |
| Subject: | how to assign a parsed file to a variable? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-3254@lists.php.net to get a copy of this message | ||
I got several mails asking if I got any replies/solutions for the
following problem that I posted days ago. Regretfully, the answer
is no. So I repost it again and see if it can be done by PHP...
GOAL: 1) parse an external file with PHP+HTML codes
2) assign the result string to a variable instead of displaying
directly on the PHP script
Example follows...
Thank you!
-------- Original Message --------
Subject: eval(...) not printing on browser, but assigning to a variable
Date: Sat, 24 Jun 2000 11:27:52 +0800
From: Vboy <vboy@bigfoot.com>
To: PHP List <php-general@lists.php.net>
Dear all,
-- test.inc (1 line file)--
<?echo "HELLO";?>
--
-- test.php (1 line file)--
$fcontent=file("test.inc");
while ( list($line_num,$line) = each($fcontent) ) {
$msg .= $line;
}
eval("?>$html_msg");
--
It echos "HELLO" on test.php.
However, I do not want the string "HELLO" printing on test.php,
I want it assigned to avariable instead, so I can use it for other
purpose. e.g. as a mail body
How do I accomplish that?
Thanks.
Regards,
vBoy