Classe Variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
i got a problem to write automaticaly varibles in classes.

i got a simple object name test like this

classes Test{
   public     $id;
   public     $text;
}

i want to affect my value to my variable like this
$test = new Test

$champ = id;
$valeur_champ = 4;

$test->$champ = $valeur_champ;

my example is stupid i know but its just for an example.
in fact when i write $test->$champ = $valeur_champ; I want that php execute $test->id = 4;


can someone help me plz,

Marc.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux