Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • thank you. Is this dynamic? i want it inside "foreach" or similar things. Commented Oct 26, 2014 at 7:03
  • Dynamic means during code execution. It does not matter when you add element to your array in foreach, for, do or just as in my examples. At the end you got array with childs added to it dynamically, depending on your code execution Commented Oct 26, 2014 at 7:06
  • how to yo can create nested arrays inside "for"? i want nest it up to 100 time! Commented Oct 26, 2014 at 7:15
  • It depends on what nesting you need? 100 elements nest into each other (what's the point?). Anyway, you can always add new item to array like that: $a['foo']['bar']['zzz']['ttt'] = array('here'); to get deep nesting. Commented Oct 26, 2014 at 7:23
  • Thank for your answer, i don't follow specific point. only i want know is it possible?! or must be nest array one by one in my code? any way i thank you for your time. :D Commented Oct 26, 2014 at 7:33