|
Posted by Jim Michaels on 10/31/95 11:37
maybe what you were tryiong to do was
$directory_tree = array(
'path' => "test path",
'name' => "test name");
instead. then you don't need the [0].
[] adds a new array index at <count++> for the newly assigned item. if the
variable didn't exist before, it starts with [0] and increments count after
that.
with the above assignment, you can add all the new items you want by just
assigning them. $directory_tree['fuzz']="blah";
"barret bonden" <arthur@networks-cc.com> wrote in message
news:EhXwf.81$h_.20@fe11.lga...
> Got it. Thank you all.
>
> ( Makes sense. What a joy of a language ~ ASP and VB.NET have been
> driving
> me nuts)
>
>
> "Zilla" <mail.is.not@an.option> wrote in message
> news:43C42721.9070009@an.option...
>> barret bonden wrote:
>> > having trouble with array of this design
>> > $directory_tree[] = array(
>> > 'path' => "test path",
>> > 'name' => "test name");
>> >
>> > all my efforts at getting at the data don't work ...
>> >
>> > //print( $directory_tree["path"]) ;
>> > //print( $directory_tree[0]) ;
>> > print( $directory_tree['path'][0]) ;
>> >
>> >
>>
>> Try:
>>
>> print($directory_tree[0]['path']);
>>
>> Zilla.
>
>
Navigation:
[Reply to this message]
|