Re: Building key sequences from strings

From: Date: Tue, 11 Jan 2005 22:24:18 +0000
Subject: Re: Building key sequences from strings
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-206120@lists.php.net to get a copy of this message
Greg Donald wrote:
On Tue, 11 Jan 2005 16:10:00 -0500 (EST), Bruce Cooper <coop.ie@excite.com> wrote:
I'm trying to set up a custom sort for multi-level [i.e. nested] arrays. The problem is I can't seem to get PHP to recognize syntax such as follows $test=$test_array.'[index][next]';
Perhaps this will work for you. <?php $index1 = 'index'; $index2 = 'next'; $test_array[$index1][$index2] = 'some value'; var_dump($test_array[$index1][$index2]); ?> -- Teach a person to fish... Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html PHP Manual: http://www.php.net/manual/en/index.php php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

« previous php.general (#206120) next »