Re: Parse PHP inside a variable
| From: | J Smith | Date: | Wed, 20 Jun 2001 22:03:13 +0000 |
| Subject: | Re: Parse PHP inside a variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-54623@lists.php.net to get a copy of this message | ||
Try eval():
http://www.php.net/manual/en/function.eval.php
i.e.
<?php
$a = 1;
$b = 2;
$str = "echo $a + $b;";
eval($str);
?>
J
"Claus Heiko Niesen" <cniesen@gmx.net> wrote in message
news:5.1.0.14.2.20010620165136.00a68728@pop.gmx.net...
> Hello
>
> I'm having a variable that contains HTML with embedded PHP code. When I
> echo it then the PHP code does not get executed. Is there a way I can
> parse/print the content of my variable?
>
> Thanks
> Claus
>
>
> --
> 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
>