variables as statements
Posted: Thu Dec 11, 2003 6:00 am
Hello,
I'm relatively new to php and was wondering...
...Is it possible to write a statement into a variable, then access the variable as though it were the results of executing the statement?
EG
<?php
$thingamebob = "1 + 1";
echo("$thingamebob");
?>
writes
1 + 1
Is there a way to get it to write
2
without going into complex regexps and stuff.
Hope someone can help.
I'm relatively new to php and was wondering...
...Is it possible to write a statement into a variable, then access the variable as though it were the results of executing the statement?
EG
<?php
$thingamebob = "1 + 1";
echo("$thingamebob");
?>
writes
1 + 1
Is there a way to get it to write
2
without going into complex regexps and stuff.
Hope someone can help.