Object member variable names
| From: | Karl Moritz Hermann | Date: | Mon, 26 Aug 2002 13:10:28 +0000 |
| Subject: | Object member variable names | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-114134@lists.php.net to get a copy of this message | ||
Hi,
I've got a little problem with variable naming of object members. Here is my
situation: I've got a website form, whoms contents will be saved in a MySQL
table with two fields: name and value. The name could be anything like
"bla->test", "array[3]->test[4]->name"...
Now I have a php script reading out the MySQL table, and I want to assign
the variables like this:
$object->$name, i.e.
$object->bla->test = "some value";
$object->array[3]->tes[4]->name = "some other value"; etc.
Using $object->$name doesn't work, as this seems to ignore submembers and
arrays.
Any ideas how to solve my problem?
Regards,
Karl
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net