ArrayIterator::uksort

(PHP 5 >= 5.2.0, PHP 7)

ArrayIterator::uksortSort by keys using a user-defined comparison function

说锟斤拷

public ArrayIterator::uksort ( callable $cmp_function ) : void

This method sorts the elements by keys using a user-supplied comparison function.

Note:

If two members compare as equal, their relative order in the sorted array is undefined.

锟斤拷锟斤拷

cmp_function

锟节碉拷一锟斤拷锟斤拷锟斤拷小锟节o拷锟斤拷锟节伙拷锟斤拷诘诙锟斤拷锟斤拷锟斤拷锟绞憋拷锟斤拷帽冉虾锟斤拷锟斤拷锟斤拷锟斤拷锟接︼拷胤锟斤拷锟揭伙拷锟叫★拷冢锟斤拷锟斤拷诨锟斤拷锟斤拷 0 锟斤拷锟斤拷锟斤拷锟斤拷

callback ( mixed $a, mixed $b ) : int

锟斤拷锟斤拷值

没锟叫凤拷锟斤拷值锟斤拷

锟轿硷拷

  • ArrayIterator::ksort() - Sort array by keys
  • ArrayIterator::uasort() - Sort with a user-defined comparison function and maintain index association
  • uksort() - 使锟斤拷锟矫伙拷锟皆讹拷锟斤拷谋冉虾锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷械募锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟�