Jump to content

help on PHP arrays


dg

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.