Re: [PHP] How to use a variable variable with an array [solved]

2011-12-14 Thread Nils Leideck
Dear Robert, On 14.12.2011, at 22:02, Robert Cummings wrote: > $path = ‘/path/to/data/in/my/arbitrarily/deep/array/'; > $array = $someBigFatArray; > $focus = &$array; > foreach( explode( '/', $path ) as $step ) > { > if ($step === '' || $step === 'CONFIGURATION’) > { > continue; >

Re: [PHP] How to use a variable variable with an array

2011-12-14 Thread Robert Cummings
On 11-12-14 01:11 AM, Laruence wrote: On Wed, Dec 14, 2011 at 9:27 AM, Nils Leideck wrote: Hi Al, many thanks for your feedback. Unfortunately I don’t know the deepness of the array so I can’t use the nested foreach() idea :-( Let me try to simplify my question (which also helps myself to cl

Re: [PHP] How to use a variable variable with an array

2011-12-14 Thread Nils Leideck
Hi FeIn and Laruence, On 14.12.2011, at 09:47, Nils Leideck wrote: >> function coolFunction( array $array, $search, $separator = ‘###' ) >> { > [...] >> if ( isset( $array[$dimension] ) ) { >> // no more dimensions to search >> if ( empty( $dimensions ) ) { >> return $array[$d

Re: [PHP] How to use a variable variable with an array

2011-12-14 Thread FeIn
maybe something like this if you are willing to get rid of your weird array dimension delimiters (you can use a dot for that for example, see below) $a = array( "a" => array( "b" => array( "c" => array( "d" => array( "e" => array(

Re: [PHP] How to use a variable variable with an array

2011-12-13 Thread Laruence
On Wed, Dec 14, 2011 at 9:27 AM, Nils Leideck wrote: > Hi Al, > > many thanks for your feedback. Unfortunately I don’t know the deepness of the > array so I can’t use the nested foreach() idea :-( Let me try to simplify my > question (which also helps myself to clarify my process ;-) > > I have

[PHP] How to use a variable variable with an array

2011-12-13 Thread Nils Leideck
Hi Al, many thanks for your feedback. Unfortunately I don’t know the deepness of the array so I can’t use the nested foreach() idea :-( Let me try to simplify my question (which also helps myself to clarify my process ;-) I have a variable where the value is a string that is exactly the path to