RE: [PHP] variables within variables - question
| From: | Rick Emery | Date: | Wed, 27 Mar 2002 18:49:04 +0000 |
| Subject: | RE: [PHP] variables within variables - question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90401@lists.php.net to get a copy of this message | ||
$field2 = "<".$$field;
-----Original Message-----
From: Phil Schwarzmann [mailto:pschwar@jhmi.edu]
Sent: Wednesday, March 27, 2002 12:33 PM
To: php-general@lists.php.net
Subject: [PHP] variables within variables - question
Im having a VERY hard time trying to explain this....
Here is a bit of my code...
for ($i = 0; $i < $num_fields; $i++)
{
$field = mysql_field_name($result, $i);
$field2 = "<".$field;
$output = str_replace($field2, $field), $output);
}
The problem I'm having here is that the variable $field contains a
string (a name of one of my fields in my table). I need for the
variable $field to actually point to the another variable, not just
contain the string.
This little loop here is supposed to go through a RTF file and replace
all the $field2 it finds with $field.
Am I making sense?
THANKS!!!!!!!!!!!!!!!!!!!!!!!