array keys as variable names
Posted: Thu Jul 25, 2013 5:43 am
I have a multidimensional array that is extremely long and prone to syntax errors. I would like to take the keys at a particular dimension and make them locals for processing, and store their array value as the value for that variable. The problem is that I am creating variable names from variables themselves, which results in a 'bad destination' error. Is there a good way around this?
so we would end up with a variable called 'theLion' which hold value 'courage', and so on.
Code: Select all
. . . [dimension] => Array
. . . . [lion] => courage
. . . . [scarecrow] => brains
. . . . [tinman] => heart