public function arrayRand($array, $num = 1) {
    $keys = array_keys($array);
    $numKeys = sizeof($keys);
    if($num == 1) {
      return $keys[$this->int(0, $numKeys-1)];
    }

    for($i=0; $i < $num; $i++) {
      $picked[] = $keys[$this->int(0, $numKeys-1)];
    }
    return $picked;
  }
public function arrayRand($array, $num = 1) {
    $keys = array_keys($array);
    $numKeys = sizeof($keys);
    if($num == 1) {
      return $keys[$this->int(0, $numKeys-1)];
    }

    for($i=0; $i < $num; $i++) {
      $picked[] = $keys[$this->int(0, $numKeys-1)];
    }
    return $picked;
  }
public function arrayRand ( $ array , $ num = 1 ) { $ keys = array_keys ( $ array ) ; $ numKeys = sizeof ( $ keys ) ; if ( $ num == 1 ) { return $ keys [ $ this -> int ( 0 , $ numKeys - 1 ) ] ; } for ( $ i = 0 ; $ i < $ num ; $ i ++ ) { $ picked [ ] = $ keys [ $ this -> int ( 0 , $ numKeys - 1 ) ] ; } return $ picked ; }
Return one or more random random keys from an array.

@param array $array
Input array.

@param integer $num
Number of keys to pick.

@return mixed
String with the key, or array containing multiple keys.
Return one or more random random keys from an array .