Re: Is there a way to get a variable name as a string?
| From: | Tyler Kiley | Date: | Tue, 19 Jul 2005 04:20:10 +0000 |
| Subject: | Re: Is there a way to get a variable name as a string? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-218938@lists.php.net to get a copy of this message | ||
function named_print($var_name) {
return "echo 'the variable named $var_name is set to ' . \$var_name;"
}
eval(named_print($foo));
;-)
Tyler