Re: Name of variable to string
| From: | Eric Butera | Date: | Fri, 08 Feb 2008 19:18:03 +0000 |
| Subject: | Re: Name of variable to string | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-268969@lists.php.net to get a copy of this message | ||
On Feb 8, 2008 1:53 PM, David Giragosian <dgiragosian@gmail.com> wrote:
> On 2/8/08, Richard Lynch <ceo@l-i-e.com> wrote:
> >
> > On Fri, February 8, 2008 9:14 am, tedd wrote:
> > > From a variable with the name of $this_variable -- how do I get a
> > > string 'this_variable' ?
> >
> > You don't...
> >
> > Consider this:
> >
> > function foo($bar){
> > //what would your function output?
> > }
> >
> > $baz = 3;
> > foo($baz);
> >
> > --
>
>
> If you dynamically created the variable:
>
> ${ 'something' . '_' . 'somethingElse' };
>
> then you'd have access to it via the variable name parts.
>
> David
>
That is ridiculous.