Just kidding of course...but it's an interesting problem...and I'll be sure to add your name and credits to the function comments
I have a function, which is basically scanning one array and comparing it's values to another array and conducting a trivial multi-field comparison...
Like a SQL:
Code: Select all
SELECT * FROM table WHERE name = "Bob" and age = 97The way I match criteria and conclude an answer is by comparing each item against another and the result of that basic test is stored or pushed onto an array...basic boolean test will always yield TRUE or FALSE(1 or 0)...
At the end of looping I then compare the number of elements in the array which holds the indivual results to the SUM of all values in the array which holds results...
Code: Select all
$arr[0] = 1; // Username test
$arr[1] = 1; // Postal test
$arr[2] = 1; // Address test
...This is how I've done it thus far...but I am convinced there is a better way...by I am brain dead for the day...at least when working on this...
So what do you think?
Can you come up with a more effective & efficient solution?
I've implemented a second solution, but I have to benchmark it first...
I'm curious what someone else can come up with...
Cheers