Array path from variable in PHP
问题 So I wrote a class that can parse XML documents and create SQL queries from it to update or insert new rows depending on the settings. Because the script has to work with any amount of nested blocks, the array that I'm putting all the values in has its path dynamically created much like the following example: $path = array('field1','field2'); $path = "['".implode("']['",$path)."']"; eval("\$array".$path."['value'] = 'test';"); Basically $path contains an array that shows how deep in the array