| |
Using multi-dimension arrays with caution | page 12 of 15 |
Try to avoid excessive use of arrays, especially arrays of arrays,
unless you really are handling data with two or more dimensions. For
example, avoid using $array[0][...] to store one set of data
such as the names of the months in a year, and $array[1][...]
to store another set of loosely related information, such as sales data
for each month. From a performance standpoint, it is more
efficient to use two arrays such as $array1[...] (storing
the names of the months) and $array2[...] (storing the sales
data for each month).
|