codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<? $arr = array( 'testRootKey' => array( 'testKey' => array( 'prop1' => 'works' ) ) ); $rootKey = 'testRootKey'; $testKey = 'testKey'; $propKey = 'prop1'; $nonExistingPropkey = 'prop2'; echo $arr[ $rootKey ][ $testKey ][ $propKey ]; // -> works echo "\n"; $arr[ $rootKey ][ $testKey ][ $nonExistingPropkey ] = 'new prop'; echo $arr[ $rootKey ][ $testKey ][ $nonExistingPropkey ]; // -> new prop
Private
[
?
]
Run code
Submit