Including variables
| From: | Matt Browne | Date: | Thu, 26 Sep 2002 10:03:16 +0000 |
| Subject: | Including variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-117686@lists.php.net to get a copy of this message | ||
Morning!
I'm having quite a dumb problem with PHP... It's probably more a result
of brain freeze than anything else, but if anyone could help it'd be
very much appreciated.
Basically, I need to include() the contents of a variable. Saving the
contents to a temporary file and then using include() would be
inconvenient.
What I mean is that I need PHP to display the contents of a variable,
parsing it as if it's in HTML mode - ie the variable could contain:
<p>Some text here.</p>
<?php print("<p>Some more text.</p>"); ?>
<p>The last bit of text.</p>
... and the output would be:
<p>Some text here.</p>
<p>Some more text.</p>
<p>The last bit of text.</p>
What the best way of doing this?
Cheers in anticipation!
--
Matt Browne <mattb@fusion-advertising.co.uk>