dg Posted July 18, 2007 Share Posted July 18, 2007 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 Quote Link to comment Share on other sites More sharing options...
clearstatcache Posted July 18, 2007 Share Posted July 18, 2007 dunno w/c is best to use but i prefer using .... $aTotalsMarks[$sSchool][$sDivision][$iRollNumber][$sExamCode][$sSubject]; Quote Link to comment Share on other sites More sharing options...
Wuhtzu Posted July 18, 2007 Share Posted July 18, 2007 As with any other performance related issue in PHP I think the answer is: As long as you do not do this 50000 times in one script I don't think you'll see a difference. Get the execution time of your script with both methods and decide which to use (+ report back the result ): http://no2.php.net/microtime Quote Link to comment Share on other sites More sharing options...
clearstatcache Posted July 18, 2007 Share Posted July 18, 2007 i agree with wuhtzu........ you used the 1 u r more convenient with......dat is if the the two arrays have a very slight difference... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.