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 Link to comment https://forums.phpfreaks.com/topic/60502-help-on-php-arrays/ 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]; Link to comment https://forums.phpfreaks.com/topic/60502-help-on-php-arrays/#findComment-300977 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 Link to comment https://forums.phpfreaks.com/topic/60502-help-on-php-arrays/#findComment-300980 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... Link to comment https://forums.phpfreaks.com/topic/60502-help-on-php-arrays/#findComment-300983 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.