Re: how to assign a parsed file to a variable?
| From: | (Delbono) | Date: | Tue, 27 Jun 2000 01:10:32 +0000 |
| Subject: | Re: how to assign a parsed file to a variable? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3260@lists.php.net to get a copy of this message | ||
Did you try with variable variables?
Sorry if this is a stupid sugestion...
Nicola Delbono
----- Original Message -----
From: "Vboy" <vboy@bigfoot.com>
To: "PHP List" <php-general@lists.php.net>
Sent: Tuesday, June 27, 2000 2:48 AM
Subject: [PHP-GENERAL] how to assign a parsed file to a variable?
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>