Warning: array_multisort () [function.array-multisort]: argument # 1 expected as an array or sort flag in
the following code throws an error in the header. I tried to do this, but all I had were pages that got the same error (not an explanation). This is not a problem as it actually works and canceling the error with @ works great. Although I'm still wondering why I couldn't execute array_multisort just once without getting this error.
public function getMostRelevant(){
list($occurrences, $keywords) = $this->occurr_keyw_array;
array_multisort($occurrences, SORT_DESC, SORT_NUMERIC,
$keywords);
$return_array = array(
array($occurrences[0], $keywords[0]),
array($occurrences[1], $keywords[1]),
array($occurrences[2], $keywords[2])
);
return $return_array;
}
+2
a source to share
3 answers