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
Your syntax is correct:
$this->{$varName}[$key]
You can also use an extra variable for this:
$myTempArr = $this->$arrDataName; $myTempArr[ $key ];
IMHO, readability is better that way...