Using $$ to access a variable
| From: | usenet5 at hoovernebrig dot com | Date: | Mon, 23 Jul 2001 17:36:41 +0000 |
| Subject: | Using $$ to access a variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-59250@lists.php.net to get a copy of this message | ||
Please forgive my probably newbie question...
I am cycling thru my database using a SQL describe statement and then
am getting values from a form based upon the field name I find. This
is working up 'til I try to read the form data.
I have defined a variable like this:
$var = $prefix.$table_array[$iCnt][0].$postfix;
If I echo $var the printed result is:
HTTP_POST_VARS["Id_val"]
This is perfect because I want to access a field on the submitted form
named "Id_val", but when I try echoing with a $$ like this:
echo $$var
I get nothing. I was under the impression that I could access my
variable this way. Am I missing something basic here??
Thanks!
Mark