Thanks, it works!

Scott Houseman wrote:
> Hi Heiko
> 
> Try this:
> $aName = "TEAM";
> eval( '$myString = G_T_'.$aName.';' ); // evaluates to: $myString = 
> G_T_TEAM
> echo $myString; // Should print out SAFETOUR_team
> 
> I haven't tested this, but it should work.
> 
> Regards
> 
> Scott
> 
> On 10/2/2002 10:47 AM, Heiko Mundle wrote:
> 
>> Hi all,
>>
>> my script knows three different constants
>>
>> define(G_T_USER,        "user_profile");
>> define(G_T_TEAM,        "SAFETOUR_team");
>> define(G_T_CALL,        "SAFETOUR_call");
>>
>> Is it possible to get access to them, if I have the names (USER, TEAM, 
>> CALL) in a variable?
>>
>> It must be something like that:
>>
>> aName = "TEAM";
>> myString = "G_T_$sName"; // myString = "SAFETOUR_team"
>>
>>
>> Any hint to solve this problem would be useful.
>>
>> heiko
>>
>>
> 
> 


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

Reply via email to