hi all ,
need to know whether an array with too many indexes or only one index creates difference in processing time?
for example say array $aTotalsMarks

$aTotalsMarks[$sSchool][$sDivision][$iRollNumber][$sExamCode][$sSubject];

And

$aTotalsMarks[$sSchool.'##'.$sDivision.'##'.$iRollNumber.'##'.$sExamCode.'##'.$sSubject];

does the above two arrays make a difference in processing if the number of indexes are increased or decreased ?

thanx.....
-- dg

Yes, times will differ. Enough to care about? That depends on what you are doing with them.
The first will incur array access costs in accessing the deeper sub-arrays, but working with subsets of information may be faster.
The second is linear, so element access will be faster but you can't process entire subsets without picking out individual elements to work with (depending upon what you intend to do with them).
If these aren't very large arrays it will probably make little difference. If you are working in long loops on them then times could vary greatly, depending upon the operations performed.
Testing is your best friend, write clear concise code that meets your needs first and then optimize it if performance problems warrant it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.