php multidimensional arrays, memory management
- by srk
i need a structure like this
array(){
[0] = array(){
[0] = array(){
// this array will have 'n' values(n is large, like 2000)
}
[1] = array(){
// this array will have 'n' values(n is large, like 2000)
}
}
.
.
.
.
[n] = ............
n arrays will each have a 2 element array, where each element has an array of n values.
I used $list[$m][0][$n] and $list[$m][1][$n] inside 2 for loops where $m,$n vary from 0...2000
this crosses the allowed memory size.. i can change the size in php.ini, but i want to optimize my memory usage and not change the limit.
will using objects help ?
Please provide some sample code to understand. Thank you.