Looks like your trying to sequence the results of a search engine in order of the number of matches.
$matches is an array value in the second dimension of your associative array "$results". You cant sort by something that deep into your structure. You have to make $matches the key to the primary array if that is what you want to sort by.
When you write your results to the $results array, write to another array like:
$sortableArray[$key] = $matches;
Later, you can use <i>arsort</i> on $sortableArray and use $key to get the information from $results for output.
HTH
-- Rich