WITH MYSQL NOT PHP;
5. net stop mysql
6. net start mysql
7. work hard; play hard
-Original Message-
From: João Cândido de Souza Neto [mailto:[EMAIL PROTECTED]
Sent: Monday, June 26, 2006 4:13 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Re: A variable inside
Alex Major wrote:
Thanks for your help with my other question, heres a new one for you.
I need to nest a variable, inside another variable. For example:
$($buildingname)level
How (if at all) is this possible?
Thanks.
Alex.
Why? What are you doing that requires that that cannot be done with
$var=1;
$var2=$var;
echo $$var2;
It´ll echo the $var´s value.
Hope it´ll help you.
Alex Major [EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
Thanks for your help with my other question, heres a new one for you.
I need to nest a variable, inside another variable. For example:
You were on the right track, but this isn't going to work.. for a couple
reasons:
$var = 1; # this is fine
$var2 = $var; # $var2 == 1 at this point
echo $$var2; # you're going to echo $1
Putting $var in double quotes makes PHP evaluate it before assigning it to
$var2, so you won't get $var
Please excuse-me.
That $ was putted by mistake.
I´sorry...
[EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
You were on the right track, but this isn't going to work.. for a couple
reasons:
$var = 1; # this is fine
$var2 = $var; # $var2 == 1 at this point
echo $$var2; #
$v=Var_.$Nums._Stat;
$Var_Call=$$v;
--
Best regards,
George Nicolae
IT Manager
___
X-Playin - Professional Web Design
www.x-playin.f2s.com
Yoed [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I never really found the trick to this one yet,
You can see the below code in action at:
http://www.ionzoft.com/code/testing/globals.php
?
function CreateGlobals($td)
{
$td = foo;
$td_error = $td . _error;
$td_ok = $td . _ok;
global $$td_error;
global $$td_ok;
$$td_error = 'Error
Maybe something similar to this?
function test($td){
$global = global \$$td._error, \$$td._ok;;
eval($global);
$set = \$$td._error = \ERROR\; \$$td._ok = \OK\;;
eval($set);
}
test(foo);
echo $foo_error $foo_ok;
--
Justin Garrett
Martin [EMAIL PROTECTED] wrote in message
I have used:
global $$td;
in the past with success...
-Jason Garber
IonZoft.com
At 07:38 PM 9/30/2001 -0700, Justin Garrett wrote:
Maybe something similar to this?
function test($td){
$global = global \$$td._error, \$$td._ok;;
eval($global);
$set = \$$td._error = \ERROR\;
function MyFunction($td)
{
global $$td;
echo $$td; // echos 3
$$td = 5;
}
$billybob = 3;
MyFunction(billybob);
//Now $billybob = 5
-Jason Garber
IonZoft.com
At 10:25 PM 9/30/2001 -0400, you wrote:
I have used:
global $$td;
in the past with success...
-Jason
But how would you use this to create new global variables with $td as the
prefix?
$td = foo;
then we want new global variables
$foo_error and $foo_ok created.
--
Justin Garrett
Jason G. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
function MyFunction($td)
11 matches
Mail list logo