Hi all,
I need to be able to compare a lot of variables with another lot of variables.
Example:
[CODE]if ($varA1 == $varB1 &&
$varA2 == $varB2 &&
$varA3 == $varB3 &&
…
…
$varA46 == $varB46 &&
$varA47 == $varB47 &&
$varA48 == $varB48) {
//do something
}
[I]Note: There is a loop to generate the numbered variables above, but that’s not the issue. I just listed it “manually” to make ti clearer.
My query is this…
What is more efficient (in speed or memory or both)?
1) Comparing two sets of 48 variables as above?; or
2) Storing all of the variables above into two different strings and then doing a single comparison on the two strings, eg: if ($Avarsjoined == $Bvarsjoined) ?
Both methods work in my case, just wondering which is best to use.
Cheers,
Chris