justsomeguy Posted August 16, 2006 Share Posted August 16, 2006 You don't need to set $a or $b, they get set by the usort function. The point of usort is to sort the array, right? So the way that happens is that it traverses down the array and compares pairs of elements with each other to determine which element goes first. If you have complex elements (like nested arrays), then you use usort because you can specify the function that is used to compare the 2 elements being compared. So the 2 parameters to the comparison function are any 2 elements of the $results array that need to be compared with each other. If you want to see what is going on, put this at the top of the comparison function:echo "\n------------";var_dump($a);echo "\n";var_dump($;echo "\n------------";Then sort the array and view the source. Link to comment Share on other sites More sharing options...
dcole.ath.cx Posted August 17, 2006 Author Share Posted August 17, 2006 Good news, I'm done writing the search engine and I'm now debugging/testing it! Link to comment Share on other sites More sharing options...
dcole.ath.cx Posted August 20, 2006 Author Share Posted August 20, 2006 I'm about 1/4 done debugging my search engine. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now