note 24341 added to language.variables.variable
| From: | info at jjeffers dot com | Date: | Tue, 13 Aug 2002 17:58:26 +0000 |
| Subject: | note 24341 added to language.variables.variable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34947@lists.php.net to get a copy of this message | ||
Here's a simple example that writes a hidden form field when passed the variable name.
function print_hidden($el){
GLOBAL ${$el};
echo("<input type=hidden name=$el value='" . ${$el} . "'>");
}
so...
print_hidden('id');
will store the value of $id in a hidden form field.
Same as typing:
<input type=hidden name=id value='$id'>
--
http://www.php.net/manual/en/language.variables.variable.php
http://master.php.net/manage/user-notes.php?action=edit+24341
http://master.php.net/manage/user-notes.php?action=delete+24341
http://master.php.net/manage/user-notes.php?action=reject+24341