Re: How to use a variable variable with an array
| From: | Nils Leideck | Date: | Thu, 15 Dec 2011 02:31:00 +0000 |
| Subject: | Re: How to use a variable variable with an array | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316020@lists.php.net to get a copy of this message | ||
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[$dimension];
>> }
>> // more dimensions to search but we can only go further if
>> // the current dimension value is also an array
>> if ( is_array( $array[$dimension] ) ) {
>> return coolFunction( $array[$dimension], $dimensions[0] );
> [...]
>
> That looks very promising! Great feedback!
> I will try this today and feedback.
The function above works pretty well for my needs, many thanks for your valuable feedback!
Cheers, Nils
--
http://webint.cryptonode.de / a Fractal project