Jump to content

Accessing a Passed Variable's Previous Name


voidstate

Recommended Posts

Hi

 

I want to pass a variable to a function and have that function add it to an array, using the variable's name (before it was passed) without the dollar sign as the key.

 

So...

 

$data = 'someString'

 

would be added to my varArray array as:

varArray( 'data' => 'someString' )

 

while...

 

$moreData = 'anotherString'

 

would change the array to:

 

varArray( 'data' => 'someString' ,  'moreData ' => 'anotherString' )

 

and so on.

 

Is it possible to access the name a cariable had before being passed?

 

Cheers

 

voidstate

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.