|
-
Apr 6th, 2010, 12:51 AM
#1
Thread Starter
Hyperactive Member
Arrays with Dynamic Dimensions
What is the easiest way to see how many dimensions an array has?
The reason is, I'm trying to create a sort of node tree, and as my data parser reads deeper in a file, it needs to add to an array like this:
PHP Code:
$node[0] = "a node";
then, the next child would be:
PHP Code:
$node[0][0] = "a child";
...and eventually I'm pretty far from home:
PHP Code:
$node[3][0][0][5] = "some pretty deep data";
Since there is no way to tell the number of children that a file may generate in parsing, at times I need to find out how deep I am, achieving the code snippets above?
Last edited by tomcatexodus; Apr 6th, 2010 at 12:55 AM.
IWS
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|