You are here: Re: [PHP] Building key sequences from strings « PHP « IT news, forums, messages
Re: [PHP] Building key sequences from strings

Posted by Jason Barnett on 10/02/58 11:05

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация