(PHP 5 >= 5.2.0, PHP 7, PHP 8)
ArrayIterator::uasort — Sort with a user-defined comparison function and maintain index association
This method sorts the elements such that indices maintain their correlation with the values they are associated with, using a user-defined comparison function.
注意:
如果兩個(gè)成員完全相同,那么它們將保持原來(lái)的順序。 在 PHP 8.0.0 之前,它們在排序數組中的相對順序是未定義的。
callback
在第一個(gè)參數小于,等于或大于第二個(gè)參數時(shí),該比較函數必須相應地返回一個(gè)小于,等于或大于 0 的整數。
總是返回 true
。