note 59039 deleted from function.eval by sp
| From: | sp@php.net | Date: | Sun, 22 Jan 2006 09:01:57 +0000 |
| Subject: | note 59039 deleted from function.eval by sp | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-102228@lists.php.net to get a copy of this message | ||
Note Submitter: eval
----
You can also create a function that set a variable and print it:
function set_and_print($var, $value) {
echo $value;
eval("\$$var = \"$value\";");
}
to use it:
set_and_print("var", "hi");
this must display "hi" and set $var with value "hi".