Re: Building key sequences from strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greg Donald wrote:
On Tue, 11 Jan 2005 16:10:00 -0500 (EST), Bruce Cooper
<coop.ie@xxxxxxxxxx> 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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux