SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Exploding
-
Jul 12, 2009, 02:39 #1
Exploding
Hi,
You know when you can't find a simple solution without creating lines of code?
Well this is it - can someone suggest a simple, clean way of doing it.
PHP Code:$Config = array(
'system' => array(
'memory' => array(
'maxmemory' => 16
)
)
);
$Query = "system.memory.maxmemory";
Keep life simple... don't put your head through plexiglass.
-
Jul 12, 2009, 03:06 #2PHP Code:
foreach ( explode( '.', $query ) as $test ) {
if ( !isset( $tmp_config ) ) $tmp_config =& $global_config;
if ( !isset( $tmp_config[ $test ] ) ) {
$reached = false; break;
}
$tmp_config =& $tmp_config[ $test ];
$reached = true;
}
if ( $reached === true ) echo 'For config?';
Bookmarks