Ge64 Posted December 18, 2006 Share Posted December 18, 2006 Hi,Is there a function that returns the name of the variable? Like:[code]$variable_name = varname($somevariable);//$variable_name == "somevariable"[/code]The other way around would also work, like:[code]$somevariable = variable('variable_name');//$somevariable == $variable_name[/code]Or is there any other way to get that? Thanks already :P Link to comment https://forums.phpfreaks.com/topic/31053-getting-the-name-of-a-variable-in-a-string/ Share on other sites More sharing options...
trq Posted December 18, 2006 Share Posted December 18, 2006 Nope. Link to comment https://forums.phpfreaks.com/topic/31053-getting-the-name-of-a-variable-in-a-string/#findComment-143389 Share on other sites More sharing options...
Ge64 Posted December 18, 2006 Author Share Posted December 18, 2006 ??? Why not :-[ Edit:Someone on another forum pointed me to [url=http://us3.php.net/manual/en/language.variables.variable.php]variable variables[/url]. Thats exactly what I need :) thanks anyway Link to comment https://forums.phpfreaks.com/topic/31053-getting-the-name-of-a-variable-in-a-string/#findComment-143391 Share on other sites More sharing options...
kenrbnsn Posted December 18, 2006 Share Posted December 18, 2006 But that's not what you asked about...Ken Link to comment https://forums.phpfreaks.com/topic/31053-getting-the-name-of-a-variable-in-a-string/#findComment-143395 Share on other sites More sharing options...
Ge64 Posted December 18, 2006 Author Share Posted December 18, 2006 Well not exactly but it does do something similar, that's why I said 'or any other way to do that'. Well maybe I should have posted more about what I'm trying to accomplish Link to comment https://forums.phpfreaks.com/topic/31053-getting-the-name-of-a-variable-in-a-string/#findComment-143401 Share on other sites More sharing options...
redarrow Posted December 18, 2006 Share Posted December 18, 2006 dont get it are you trying to get somthink to happen when a varable name is called but you want the varable within the code to exec.you need to use functions ok to call a varable within it. Link to comment https://forums.phpfreaks.com/topic/31053-getting-the-name-of-a-variable-in-a-string/#findComment-143405 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.