Jump to content

Search Engine


dcole.ath.cx

Recommended Posts

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

  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...