NYCPHP Meetup

NYPHP.org

[nycphp-talk] Eval question

Jon Baer jonbaer at jonbaer.com
Thu Oct 12 10:26:32 EDT 2006


You are quoting w/ a literal string ... try ...

<?php
   $x = 3;
   $y = 4;
   $calc_str = "$x * $y";
   eval("echo $calc_str;");
?>

- Jon

On Oct 12, 2006, at 10:18 AM, LK wrote:

> <?php
>   $x = 3;
>   $y = 4;
>   $calc_str = '$x * $y';
>   eval("echo \"$calc_str\";");
> ?>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20061012/cc8b6cb5/attachment.html>


More information about the talk mailing list