when i say
var_dump($this->variables['DEFAULTS_VALUES']);
I get the Following array
array(1) {
["ABE LOB RPT"]=>
string(8) "BEST2"
}
how do i get the value ["ABE BBB CCC"] from this array
when i say in this way $this->variables['DEFAULTS_VALUES'][0]
It says UNDEFINED OFFSET: 0 .how do i get the value ["ABE BBB CCC"] from this array
You’re getting “undefined offset” errors because there’s no value at index 0 in that array. PHP arrays are actually “ordered maps”, and what looks like the first value here is actually a key —
$this->variables['DEFAULTS_VALUES']['ABE LOB RPT']would give you back ‘BEST2’.If you actually want the keys, the
array_keysfunction would give them to you. Or you could use a foreach loop:In your case, the one and only time through the loop would print out “ABE LOB RPT: BEST2”.