[PHPLIB] variable variables as object names From: Martin Decker (martin.decker <email protected>)
Date: 12/12/99

Good afternoon,

I have a question regarding variable variables as object names:

The following code does not work:

                $var = "cart_st";
                         $st_ID = $db->f("st_ID");
                         $var .= $st_ID;
                //$$var is substituted by eg: $cart_st1
                //echo $$var shows: Object

                $$var->add_item($art,$num); //

It seams that in front of the -> operater, the $$ substitution does not
work. Can
somebody give me an alternative?

Martin

*****************************************
Martin Decker, martin.decker <email protected>
Telekommunikationstechnik und -systeme
Fachhochschule Salzburg
Jakob-Haringer-Str. 1a/II/12
Tel. 0664 5775697

-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.