I tried to access with $this->$arrDataName[$key] on the element with the key $key from the array $this->$arrDataName. But PHP in
$this->$arrDataName[$key]
$key
$this->$arrDataName
myArray = array('FooBar'); $arrayName = 'myArray'; echo $this->{$arrayName}[0]; } } new Foo;
This worked perfectly for me, it printed FooBar.
FooBar