View Full Version : storing vs not

03-19-2007, 03: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, 05: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, 05: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, 05:28 AM
alright cool! thanks :) saved me some trouble :P

03-19-2007, 04:14 PM
I hate code like ...

$var1 =$r['var1'];
//.... etc etc//

I don't see the point unless one really needs the typing practice ?