Posted by Jeff North on 04/29/07 00:49
On Sat, 28 Apr 2007 22:11:45 GMT, in comp.lang.php "Jon Slaughter"
<Jon_Slaughter@Hotmail.com>
<BEPYh.1450$RX.384@newssvr11.news.prodigy.net> wrote:
>|
>| "Janwillem Borleffs" <jw@jwscripts.com> wrote in message
>| news:4633bec1$0$31213$dbd43001@news.euronet.nl...
>| > Jon Slaughter wrote:
>| >> Is there any command that essentially executes the code and then
>| >> echo's it?
>| >
>| > For this specific case you could use eval:
>| >
>| > $code = "?><body>blah<?php echo 'Hello'; ?></body>";
>| > eval($code);
>| >
>| > Note that the closing tag at the beginning of the eval string is
>| > mandatory.
>| >
>| >
>|
>| Ok. Thats not the specific case I need but maybe it will still work? It is
>| essentially what I have. That is, I have an html file with some php code in
>| it similar to the example but just more complex. (actually right now its
>| just plain html but when I want to add some php stuff I'll need to be able
>| to have it evaluated).
Make sure the file has the extension of php.
---------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Navigation:
[Reply to this message]
|