Some time ago I got help from this forum on how to
convert a string to a variable in php.
Essentially, I have an associative array that contains array names as strings.
I want to get to the values contained in arrays as strings. So I need to
convert the string rep of the array to the actual array variable.
PHP Code:
${$_arrayNames['_arrayX']} ['Acrylics'];
Here $_arrayNames contains the string representation of an array name with
the value 'Acrylics'. So I want the value in $_arrayX['Acrylics']
This does work. BUT.....
in OOP context:
PHP Code:
$this->depts = self::$_arrayNames['departments']; // string '_deptDefaults'
print ${$this->depts}['hm']; // nada
require_once(${$this->depts}['hm']); // Fatal error.... etc...
/// ..etc...
The ultimate value is supposed to be a file name with path as the value
for $_deptDefaults['hm']
require_once() is failing
SO.... any suggestions about how to get this to work?
(as I look over this I think I know why it isn't working... there is not a record in the object, of the arrays that are being referenced in arrayNames)
Well, thanks for time and attention