php8.5
Home/ Manual/ spl / arrayiterator/ ArrayIterator::uasort

ArrayIterator::uasort

PHP function Edit on GitHub ✎

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

Sort with a user-defined comparison function and maintain index association

Description

ArrayIterator::uasort(callable $callback): true

This method sorts the elements such that indices maintain their correlation with the values they are associated with, using a user-defined comparison function.

Sort-unstable

Parameters

callback

Description

Return Values

Always

Changelog

VersionDescription

See Also

  • ArrayIterator::asort
  • ArrayIterator::ksort
  • ArrayIterator::natcasesort
  • ArrayIterator::natsort
  • ArrayIterator::uksort
  • uasort()

Source: reference/spl/arrayiterator/uasort.xml · from the official PHP manual (php/doc-en)