Warning: array_multisort() [function.array-multisort]: Argument #1 is expected to be an array or a

Posted by johnny on Stack Overflow See other posts from Stack Overflow or by johnny
Published on 2010-04-13T21:04:24Z Indexed on 2010/04/13 21:23 UTC
Read the original article Hit count: 490

Filed under:
|
|

Hi, the following code produces the error in the title. I've tried to google it, but all I got were pages who got the same error (and not an explanation thereof). This isn't really a problem since it's actually working and cancelling the error out with the @ works out just fine. Though I'm still wondering why I haven't been able to 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;

 }

© Stack Overflow or respective owner

Related posts about php

Related posts about error