Re: how to include() a string
| From: | Luca | Date: | Sun, 29 Apr 2001 14:57:20 +0000 |
| Subject: | Re: how to include() a string | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50812@lists.php.net to get a copy of this message | ||
Andi Gutmans <andi@zend.com> wrote:
> Do you mean eval()? It evaluates code which is a string, for example:
> eval ('print(2);');
>
> If you can develop your application without using eval() you're better off
> as it is very slow.
Unfortunately eval() is not what I need. I want the string to be
parsed *in HTML mode* [1], just like include() and require() do. The
problem is they work with files, while what I have is a variable.
I could write the string to a temp file, and then use include(), but
that would be kind of slow. It would be done in every page, so it
needs to be reasonably fast (my application is already slowed down
by the use of XSLT).
[1] see http://www.php.net/manual/en/function.include.php,
3rd paragraph
Regards,
Luca