Re: CONTINUE - variable problem - help!

From: Date: Wed, 16 Jan 2002 19:24:02 +0000
Subject: Re: CONTINUE - variable problem - help!
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-80798@lists.php.net to get a copy of this message
Dani, Not that I've tried this exact condition but the internal portion of this array name works elsewhere. Give it a try. $row['${"somename_".($var)}'] ----- Original Message ----- From: Dani <universal2001@iprimus.com.au> To: Stefan Rusterholz <scripting@interaktion.ch>; <php-general@lists.php.net> Sent: Wednesday, January 16, 2002 7:33 AM Subject: [PHP] CONTINUE - variable problem - help! > hi again! > > I tried it but it desn't give me any result back. > It dosn't print any error message but it desn't print my result either. > > this is how I place the code: > > > echo "...some html code..."; > $row["somename_$var"]; > echo "...the continuation of the html code"; > > thanks! > > Stefan Rusterholz wrote: > > > > Hi! > > > > > > I 'm trying not to hard code my php coding and I'm trying to pass a > > > variable name into the $row[coloumname_$variable]; > > $row["columname_$variable"] should do it. > > $row[constant] is threaten as constant which is normally not the programmers > > intention (set_error_reporting(0) and you'll see PHP's complaints about it) > > so PHP converts it to $row['constant']. > > You may now understand, that PHP "translates" your code to > > $row['coloumname_$variable'] whre $variable is a string and not a variable. > > > > I hope, I could express myself understandable :) > > best regards > > Stefan Rusterholz > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#80798) next »