473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

second array level

Dear all
How can I directly acces the second level of an array.

At the moment I am doing something like this.
$subset=$ini_array["section"];
$number=$subset["number"];
I would like to increment number by 1 without storing the data in a
different variable.
($ini_array["section"])["number"]


Array
(
[section] => Array
(
[number] => 1
)
)

regards

Reimar
--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.*****@fz-juelich.de
-------------------------------------------------------------------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/i...lib_intro.html
================================================== =================
Jul 17 '05 #1
1 2181
Reimar Bauer wrote:
Dear all
How can I directly acces the second level of an array.

At the moment I am doing something like this.
$subset=$ini_array["section"];
$number=$subset["number"];
I would like to increment number by 1 without storing the data in a
different variable.
($ini_array["section"])["number"]


$ini_array["section"]["number"]++;

OR

++$ini_array["section"]["number"];

will do it.

see
http://www.php.net/manual/en/languag....increment.php

and
http://www.php.net/manual/en/language.types.array.php
see the third example of how to access an item from a multi-dimensional
array directly.

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: lawrence | last post by:
I wanted to test xml_parse_into_struct() so I took the example off of www.php.net and put this code up on a site: <?php $simple = <<<END <item>
47
by: VK | last post by:
Or why I just did myArray = "Computers" but myArray.length is showing 0. What a hey? There is a new trend to treat arrays and hashes as they were some variations of the same thing. But they...
8
by: kings_oz | last post by:
I have an array or items each item in the array can contain another array of other items and that array of other items can contain more array of item. I want recursively iterate through the array...
7
by: Bangalore | last post by:
Hi all, Plz clarify me, on the implementation of two or three dimensional array using overloaded operator. Thanks, in advance Bangalore
29
by: shmartonak | last post by:
For maximum portability what should the type of an array index be? Can any integer type be used safely? Or should I only use an unsigned type? Or what? If I'm using pointers to access array...
2
by: julian_m | last post by:
let's say that I've an array like this: $AL_array = Array ( => Array ( => 1 ) , => Array ( => 2 ) , => Array ( => 3 ) , => Array ( => 4 ) , => Array ( => 1 ) , => Array ( => 2 )...
5
by: Manish | last post by:
This is the print_r() for a variable $categories. $categories :: Array ( =Array ( =Array (
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
5
by: Bob Nelson | last post by:
Right next to K&R2 on my bookshelf is _C Programming: A Modern Approach_ by Professor K.N. King. The second edition of this book is now available. See this URL for details: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.