long time reader, first time question-er.
I've found myself in a unique situation, and the most effective way I can find to solve my problem is by building a string of keys to obtain a value. I was having trouble with the code block indenting on here, so I've provided my code snippet on Pastebin: http://pastebin.com/Nn8xS5Vx
What I'm trying to do there is step through each level of the structure, checking each level for errors, and if any are found, reporting them back into the $errors_array
in the following format:
[Level eg:Enterprise]
[0] Enterprise Name
[Platform]
[0] Platform Name
The problem is that I'm not going down through the levels when I retrieve the name, it's looking at the root of the array. My idea was to write a for loop to construct a string to provide the current level, so the name can be retrieved.
What I'm looking to do is build a string containing keys of each level, and then use that string of keys to refer to the $node
variable and pull the name respectively. Here's a pseudo-example:
$keyString = "[Enterprise][Platform][Offering]"
And I would then use something to the effect of:
$node[$keystring]['name']
I hope I've explained that well enough. If anyone has any suggestions as to how I could achieve this, or even a better method of getting the same end result, I would greatly appreciate it.