View Full Version : storing vs not
03-19-2007, 02:17 AM
what is more efficient?
printing $database[somevar] a couple times in your code or manipulting it , such as multiplying it by 2, or storing it under $myvar and using $myvar?
or is there no difference?
03-19-2007, 04:00 AM
In my honest opinion I find no real difference, but I'm sure you will get the odd guy that will argue that it makes a difference. I however found that certain operations didn't work with the array value but did with the regular variable.
03-19-2007, 04:22 AM
well depends on the situation you are using it, if you have an array of information and need all of them to be multiplied by 2 or need every other one multiplied by 2 you would use an array with a for loop. It also really makes no difference ans is more a personal preference than anything else as dniwebdesign stated.
03-19-2007, 04:28 AM
alright cool! thanks :) saved me some trouble :P
03-19-2007, 03:14 PM
I hate code like ...
//.... etc etc//
I don't see the point unless one really needs the typing practice ?
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.